// yukicoder: No.648 おやすみ // 2019.4.30 bal4u #include #include int main() { int s; long long n; scanf("%lld", &n); n <<= 3, n++; s = (int)sqrt((double)n); if ((long long)s*s != n || (s & 1) == 0) puts("NO"); else { puts("YES"); printf("%d\n", (s-1)>>1); } return 0; }