def main(): inp1 = int(input()) sec = 1 sums = 0 loop_flg = True while loop_flg: if inp1 == sums: print("YES") print(sec) break elif inp1 < sums: print("NO") break else: pass sums = sums + sec sec += 1 if __name__ == '__main__': main()