#include <stdio.h>
int isKthBitSet(int n, int k) {
// Check if the k-th bit is set
if (n & (1 << k)) {
// Bit is set
return 1;
} else {
// Bit is not set
return 0;
}
}
int main() {
int n, k;
scanf("%d %d", &n, &k);
printf("%d", isKthBitSet(n, k));
return 0;
}