M = 10 ** 6 d = [False] * M for i in range(M): d[i * i % M] = True print('YES' if d[int(input())] else 'NO')