b, c = map(int, input().split())
found = False
for a in [0, 1, 2]:
    if (a - b) % 3 == 1 and (a - c) % 3 == 1:
        found = True
        break
print("Yes" if found else "No")