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