def get(): return list(map(int, input().strip().split(' '))) N, K = get() x = 1 << (N - K) if K == 1: x -= 1 print(x)