n = int(input()) s = 2*n check = int(s**0.5) if check*(check+1) == s: print('YES') print(check) else: print('NO')