Tri-Isomorphism

Let V (G) be the vertex set of a simple graph and E(G) its edge set. An Isomorphism from a simple graph G to a simple graph H is a bijection f : V (G) → V (H) such that uv ∈ E(G) if and only if f(u)f(v) ∈ E(H). We say, G is isomorphic to H if there is an isomorphism from G to H. A complete graph is a simple graph whose vertices are pairwise adjacent: the unlabeled complete graph with n vertices is denoted Kn. For example, the following figure shows K5. Finally, a decomposition of a graph is a list of subgraphs such that each edge appears in exactly one subgraph in the list. Now, given a positive integer n, you are to determine if Kn decomposes into three pairwise-isomorphic subgraphs. Input First line of each test case consists of a positive integer n (n ≤ 100). The end of input will be indicated by a case where n = 0. This case should not be processed. Output For each test case, print ‘YES’ if Kn can be decomposed into three pairwise-isomorphic subgraphs and ‘NO’ otherwise. Constraints • n < 100 Sample Input 4 5 0 Sample Output YES NO