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