n = int(input()) if (n % 6) + 1 == 6: print('yes') else: print('no')