#include int main(){ long in,out=0,i=1; scanf("%ld\n", &in); while(in>out){ out+=i; i++; } if(in==out){ printf("YES\n%ld\n", i); }else{ printf("NO\n"); } return 0; }