#include void run(void){ int N,K; scanf("%d%d",&N,&K); if(N==K){ printf("1\n"); return; } if(K==1){ if(N==2){ printf("0\n"); } else { printf("%d\n",(1<<(N-1))-N+1); } } else { printf("%d\n",(1<<(N-K))); } return; } int main(void){ run(); return 0; }