from math import sqrt N = int(input()) n = sqrt(2*N+1/4)-1/2 if (n).is_integer() and n*(n+1) == N: print("YES") print(int(n)) else: print("NO")