#include #define rep(i,n) for(int i=0;i ; const int INF = 1e9; const int MOD = 1000000007; int main(){ int n,k; cin >> n >> k; if(n+1 <= k){ cout << "INF" << endl; return 0; } ll ans = 0; int res = 1; while(res < n) res *= 2; for(int x=n;x<=res;x++){ if((x & n) != n) continue; for(int y=x;y<=x+k;y++){ if((x & y) == n) ans ++; } } cout << ans << endl; return 0; }