#include<iostream> using namespace std; int main() { int n, k; cin >> n >> k; int res = (n >> k) & 1; cout << res << endl; return 0; }