void main(){ import std.stdio, std.string, std.conv, std.algorithm; long n; rd(n); // i*(i+1)/2 auto ok=0L, ng=to!(long)(2*1e9); while(ng-ok>1){ auto m=(ng+ok)/2; m*(m+1)/2>n ? ng : ok = m; } if(ok*(ok+1)/2==n){writeln("YES"); writeln(ok);} else writeln("NO"); } void rd(T...)(ref T x){ import std.stdio, std.string, std.conv; auto l=readln.split; assert(l.length==x.length); foreach(i, ref e; x){ e=l[i].to!(typeof(e)); } }