N = int(input()) T = int((N * 2) ** 0.5) * (int((N * 2) ** 0.5) + 1) // 2 print("YES\n" + str(int((N * 2) ** 0.5)) if T == N else "NO")