function Main(input) { inputs = input.split('\n'); let N = inputs[0].split(' ').map((e) => e - 0); let lb = 0; let ub = 10**9; while (lb <= ub) { let mb = lb + ub >> 1; let s = 0; for (let i = mb; i; i >>= 1) { s += i; } if (s == N) break; if (s < N) lb = mb + 1; else ub = mb - 1; } console.log(['NO', 'YES'][lb <= ub ? 1 : 0]); } Main(require('fs').readFileSync('/dev/stdin', 'utf8')); function debug() { let input = document.getElementById('input').value; Main(input); }