#include <cstdlib>
#include <iostream>
using namespace std;

long n, t;

int main(void) {
   cin >> n >> t;
   if (t >= 0) {
      cout << (t >> (n-1)) << endl;
   } else if (n == 1) {
      cout << (t) << endl;
   } else {
      cout << (-(abs(t) >> (n-1)) -1) << endl;
   }

   return(0);  
}
