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