N, K = map(int, input().split()) print(K//(2**(N-1)))