#!/usr/bin/env python3
(x := list(map(int,input().split()))), print(["no", "yes"][x[1] == x[0] % 30 * 12])
