#No.1003 サイコロの実装 (1)
n = int(input())

if n % 6 == 0:
    print("Yes")
else:
    print("No")