a, b = map(int, input().split())

bb = (a * 12) % 360
if bb == b:
    print("yes")
else:
    print("no")
