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