def main(): n = int(input()) cnt = 0 for i in range(10**6): cnt += i if cnt == n: print('YES') print(i) exit() print('NO') if __name__ == "__main__": main()