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