n = int(input()) m =int((2*n)**0.5) if m*(m+1) == 2*n: print("YES\n{}".format(m)) else: print("NO")