n = int(input()) if n == 0: print("No") exit() # dp[i][j] = whether the current player can win with i petals left and current parity j (0: even, 1: odd) dp = [[False] * 2 for _ in range(n + 1)] # Base case: 0 petals left dp[0][0] = False # even total, current player loses dp[0][1] = True # odd total, current player wins for i in range(1, n + 1): for p in [0, 1]: can_win = False for m in [1, 2, 3]: if m > i: continue remaining = i - m new_p = (p + m) % 2 if remaining == 0: # Game ends after this move if new_p == 1: can_win = True break else: # Check if the opponent cannot win in the next state if not dp[remaining][new_p]: can_win = True break dp[i][p] = can_win print("Yes" if dp[n][0] else "No")