import math n = int(input()) a = round(math.sqrt((n*8+1))) if a**2 == n*8+1: print 'YES' print int(a) else : print 'NO'