n=int(input()) sum=0 i=0 while i<(10**10)*365*24*3600: i+=1 sum+=i if sum==n: print('YES') print(i) break elif sum>n: print('NO') break