def main(): inp1 = int(input()) count = 0 num = inp1*2 pre = int(pow((num),1/2)) plf = pow(pre,2) + pre if plf == num: print("YES") print(pre) else: print("NO") if __name__ == '__main__': main()