The following problem is well-known: given integers n and m, calculate $2^{n} \operatorname{mod} m$, 

where 2^{n} = 2·2·...·2 (n factors), and $x \operatorname{mod} y$ denotes the remainder of division of x by y.

You are asked to solve the "reverse" problem. Given integers n and m, calculate $m \operatorname{mod} 2^{n}$. 


-----Input-----

The first line contains a single integer n (1 ≤ n ≤ 10^8).

The second line contains a single integer m (1 ≤ m ≤ 10^8).


-----Output-----

Output a single integer — the value of $m \operatorname{mod} 2^{n}$.


-----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 2^4 = 16 is equal to 10.

In the second example, 58 is divisible by 2^1 = 2 without remainder, and the answer is 0.

Difficulty: interview

Starter code:

Solutions:
n = int(input())
m = int(input())

print(m % (1 << n))

n=int(input())
print(int(input())%(2**min(n,40)))


N = int(input())
M = int(input())

if N > 50:
    print(M)
else:
    print(M % (2**N))


n = int(input())
m = int(input())
print(m % (1 << n))

import sys

def main():
    n = int(input())
    m = int(input())
    if n < 50:
        m = m % pow(2, n)
    
    print(m)
    
    
	
def __starting_point():
    main() 
    

__starting_point()

#!/usr/bin/env python3

def main():
    n = int(input())
    m = int(input())
    print(m % (1 << n) if m >> n else m)

try:
    while True:
        main()
except EOFError:
    pass


n = int(input())
m = int(input())

if n > 30:
  n = 30

print(m % (2**n))

n = int(input())
m = int(input())
if n > 31:
	print(m)
else:
	print(m % 2**n)

3
# Copyright (C) 2017 Sayutin Dmitry.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; version 3
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; If not, see <http://www.gnu.org/licenses/>.

def main():
    n = int(input())
    m = int(input())

    if n >= 100:
        print(m)
    else:
        print(m % (2 ** n))

main()


y=int(input())
x=int(input())

if y>30: print(x)
else:
	z = 1
	for i in range(y):
		z *= 2
	print(x % z)

n = int(input())
m = int(input())

if n > 50: print(m)
else: print(m % (2 ** n))

n = int(input())
m = int(input())

if n >= 27:
    print(m)
else:
    k = m % (1 << n)
    print(k)

n = int(input())
m = int(input())
if n > 100:
    print (m)
else:
    print(m % 2 ** n)



n=int(input())
m=int(input())
j=1
for i in range(n):
	j*=2
	if(j>m):
		break
print(m%j)

n = int(input())
m = int(input())
cur = 1;
for i in range(n):
	cur *= 2
	if (cur > m):
		break
print(m % cur)

def ii():
    return int(input())
def mi():
    return map(int, input().split())
def li():
    return list(mi())

n = ii()
m = ii()
n = min(n, 32)
print(m % (2**n))

read = lambda: list(map(int, input().split()))
n, m = int(input()), int(input())
if n < 100:
    print(m % (2**n))
else:
    print(m)


n = int(input())
m = int(input())

r = pow(2, min(n, 60))

print(m % r)


N = int(input())
M = int(input())

if N > 32:
    print(M)
else:
    print(M%(1<<N))


n=int(input())
m=int(input())
print(m%2**n)

n,m = int(input()), int(input())
if n > 30:
    print(m)
else:
    print(m % (2 ** n))

from sys import stdin, stdout

n = int(stdin.readline())
m = int(stdin.readline())

if n >= 100:
    stdout.write(str(m))
else:
    stdout.write(str(m % (2 ** n)))

n = min(64, int(input()))
m = int(input())

print(m % (2 ** n))


n = int(input())
m = int(input())
print(m % (1 << n))

import math
n = int(input())
m = int(input())
if n <= 100:
    print(m % (2 ** n))
else:
    print(m)