// 解説見て書いただけ /** * @FileName a.cpp * @Author kanpurin * @Created 2020.06.08 16:51:50 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; ll f(int t) { ll s = 0; while(t) { s += t; t >>= 1; } return s; } int main() { int n;cin >> n; int l = 0,r = 1000000001; while(r - l > 1) { int mid = l + (r - l) / 2; if (f(mid) >= n) { r = mid; } else { l = mid; } } if (f(r) == n) { puts("YES"); } else { puts("NO"); } return 0; }