#include"bits/stdc++.h" using namespace std; using ll = long long; using ld = long double; using pii = pair; using pll = pair; #define FOR(k,m,n) for(ll (k)=(m);(k)<(n);(k)++) #define REP(i,n) FOR((i),0,(n)) #define WAITING(str) int str;std::cin>>str; #define DEBUGING(str) cout<< #str << " " str<> N >> K; REP(x, N * 16 + 4e5)FOR(y, x, x + K + 1) { if ((x&y) == N) { //cerr << x << " " << y << endl; res++; if (x > N * 4 + 1e5)cnt++; } } cout << (cnt > 0 ? "INF" : to_string(res)) << endl; return 0; }