#MTH000000024. Tam đẳng cấu (Tri-Isomorphism)

Tam đẳng cấu (Tri-Isomorphism)

Tri-Isomorphism

Source: UVa

Version: Phuoc Hung OJ Extended

Problem Statement

A simple graph has neither loops nor multiple edges. Two graphs are isomorphic if there is a bijection between their vertex sets that preserves adjacency.

KnK_n denotes the complete graph on nn vertices, so every pair of distinct vertices is connected by an edge.

A decomposition of a graph is a list of subgraphs in which every edge of the original graph appears in exactly one subgraph.

Given nn, determine whether KnK_n can be decomposed into exactly three pairwise-isomorphic subgraphs.

Input

One positive integer nn.

Output

Print YES if such a decomposition exists; otherwise print NO.

Subtasks

  • Subtask 1 (20%): n≤20n\le20.
  • Subtask 2 (30%): 21≤n≤10021\le n\le100 and n≡0n\equiv0 or 1(mod3)1\pmod3.
  • Subtask 3 (50%): Full constraints: 1≤n≤1001\le n\le100.

Examples

Input

4

Output

YES

Explanation

K4K_4 has (42)=6\binom42=6 edges. They can be partitioned into three edge sets of size 22 whose subgraphs are isomorphic, so the answer is YES.