from math import sqrt import sys n = int(input()) D = a + 8 * n if int(sqrt(D)) **2 == D: if (int(sqrt(D)) - 1) % 2 == 0: print('YES') print((int(sqrt(D))-1) // 2) exit() print('NO')