#include <stdio.h>
#define SET 1
int isKthBitSet(int n, int k) {
// Write your code here
return (n & (1 << k)) >> k; // mask to clear other bits
// then shift K-th bit to LSB
}
int main() {
int n, k;
scanf("%d %d", &n, &k);
printf("%d", isKthBitSet(n, k));
return 0;
}