The following problem is well-known: given integers n and m, calculate

<image>, 

where 2n = 2·2·...·2 (n factors), and <image> denotes the remainder of division of x by y.

You are asked to solve the "reverse" problem. Given integers n and m, calculate

<image>. 

Input

The first line contains a single integer n (1 ≤ n ≤ 108).

The second line contains a single integer m (1 ≤ m ≤ 108).

Output

Output a single integer — the value of <image>.

Examples

Input

4
42


Output

10


Input

1
58


Output

0


Input

98765432
23456789


Output

23456789

Note

In the first example, the remainder of division of 42 by 24 = 16 is equal to 10.

In the second example, 58 is divisible by 21 = 2 without remainder, and the answer is 0.
#include <bits/stdc++.h>
using namespace std;
template <typename T>
void showSTL(T H);
template <typename T, typename V>
void showSTL(pair<T, V> H);
template <typename T>
void showSTL(priority_queue<T> H);
template <typename T>
void showSTL(stack<T> H);
template <typename T, typename V>
void showSTL(map<T, V> H);
template <typename T, typename V>
void showSTL(multimap<T, V> H);
template <typename T>
void showSTL(vector<T> H);
template <typename T>
void showSTL(set<T> H);
template <typename T>
void showSTL(multiset<T> H);
template <typename T>
void showSTL(list<T> H);
void showSTL(char *H);
template <typename T>
void showSTL(deque<T> H);
template <typename T>
void showSTL(queue<T> H);
template <typename T>
void showSTL(T H) {
  stringstream ss;
  ss << H;
  cerr << ss.str();
}
template <typename T, typename V>
void showSTL(pair<T, V> H) {
  cerr << "(";
  showSTL(H.first);
  cerr << "=>";
  showSTL(H.second);
  cerr << ")";
}
template <typename T>
void showSTL(priority_queue<T> H) {
  cerr << endl;
  while (!H.empty()) {
    cerr << H.top() << endl;
    H.pop();
  }
  cerr << endl;
}
template <typename T>
void showSTL(stack<T> H) {
  cerr << endl;
  while (!H.empty()) {
    cerr << H.top() << endl;
    H.pop();
  }
}
template <typename T, typename V>
void showSTL(map<T, V> H) {
  cerr << "[ ";
  for (auto val : H) {
    showSTL(val);
    cerr << " ";
  }
  cerr << "]";
}
template <typename T, typename V>
void showSTL(multimap<T, V> H) {
  cerr << "[ ";
  for (auto val : H) {
    showSTL(val);
    cerr << " ";
  }
  cerr << "]";
}
template <typename T>
void showSTL(vector<T> H) {
  cerr << "[ ";
  for (auto val : H) {
    showSTL(val);
    cerr << ' ';
  }
  cerr << "]";
}
template <typename T>
void showSTL(set<T> H) {
  cerr << "[ ";
  for (auto val : H) {
    showSTL(val);
    cerr << ' ';
  }
  cerr << "]";
}
template <typename T>
void showSTL(multiset<T> H) {
  cerr << "[ ";
  for (auto val : H) {
    showSTL(val);
    cerr << ' ';
  }
  cerr << "]";
}
template <typename T>
void showSTL(list<T> H) {
  cerr << "[ ";
  for (auto val : H) {
    showSTL(val);
    cerr << ' ';
  }
  cerr << "]";
}
void showSTL(char *H) {
  for (int i = 0; i < strlen(H); i++) {
    showSTL(H[i]);
  };
}
template <typename T>
void showSTL(deque<T> H) {
  cerr << "[ ";
  for (auto val : H) {
    showSTL(val);
    cerr << ' ';
  }
  cerr << "]";
}
template <typename T>
void showSTL(queue<T> H) {
  cerr << "[ ";
  while (!H.empty()) {
    showSTL(H.front());
    cerr << ' ';
    H.pop();
  }
  cerr << "]";
}
vector<string> vec_spltr(string s) {
  s += ',';
  vector<string> res;
  while (!s.empty())
    res.push_back(s.substr(0, s.find(','))), s = s.substr(s.find(',') + 1);
  return res;
}
void dbg_out(vector<string> __attribute__((unused)) args,
             __attribute__((unused)) int idx,
             __attribute__((unused)) int LINE_NUM) {
  cerr << endl;
}
template <typename Head, typename... Tail>
void dbg_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
  if (idx > 0)
    cerr << ", ";
  else
    cerr << "Line(" << LINE_NUM << "):";
  cerr << " " << args[idx] << " = ";
  showSTL(H);
  dbg_out(args, idx + 1, LINE_NUM, T...);
}
long long add(long long a, long long b, int mod) {
  if ((a += b) >= mod) a -= mod;
  return a;
}
long long sub(int a, int b, int mod) {
  if ((a -= b) < 0) a += mod;
  return a;
}
long long mult(long long a, long long b, long long mod) {
  long long ans = (a % mod) * (b % mod);
  if (ans >= mod) ans %= mod;
  return ans;
}
long long bigmod(long long x, long long n, long long mod) {
  if (n == 0) return 1;
  long long ans = bigmod(x, n / 2, mod);
  ans = mult(ans, ans, mod);
  if (n & 1) ans = mult(x, n, mod);
  return ans;
}
bool isPowerOfTwo(long long x) { return x && (!(x & (x - 1))); }
bool isPerfectSquare(long double x) {
  long double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);
}
long long digNO(long long num) { return floor(log10(num)) + 1; }
int findSqrt(int n) {
  int lo = 0, hi = n;
  while (lo <= hi) {
    int mid = (lo + hi) / 2;
    if (mid * mid <= n)
      lo = mid + 1;
    else
      hi = mid - 1;
  }
  return lo - 1;
}
long long fib(long long n) {
  double phi = (1 + sqrt(5)) / 2;
  return round(pow(phi, n) / sqrt(5));
}
bool primeCheck(long long n) {
  if (n % 2 == 0) return false;
  for (long long i = 3; i * i <= n; i += 2) {
    if (n % i == 0) return false;
  }
  return true;
}
long long count_N_in_Fact(long long n, long long k) {
  long long res = 0, sum = 0;
  for (long long i = k;; i *= k) {
    res = n / i;
    if (res == 0) break;
    sum += res;
  }
  return sum;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m;
  cin >> n >> m;
  long long t = 1;
  while (n--) {
    t *= 2;
    if (t > m) {
      cout << m << endl;
      return 0;
    }
  }
  cout << m % t << endl;
  return 0;
}
