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.
/*Shabeg Singh Gill*/
//code 

import java .util.Scanner ;
import java.util.*;
import java.io.*;
import java.nio.IntBuffer;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Iterator;
//import java.io.OutputStreamReader;
import java.io.PrintWriter;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.lang.Math;
import java.io.InputStream;
import java.util.InputMismatchException;
import java.awt.Point; 
import java.util.HashMap;
import java.util.Collections;
import java.util.Arrays;
//import  java.util.Collections.reverseOrder()
 
public class cf2{
 
    public static int binarysearch(int[] arr,int num){
        int n;
        n=arr.length;
        int ans;
        ans=0;
        int start;
        start=0;
        int end ;
        end=n-1;
        while(start<=end){
            int mid;
            mid=(start+end)/2;
            if (arr[mid]>num){
                end=mid-1;
            } 
            else{
                ans=mid+1;
                start=mid+1;
            }
        }
        return ans;
    }

    public static void merger(int startind,int midind,int endind, ArrayList<Integer> arr){
        ArrayList<Integer> mergedSortedArray;
         mergedSortedArray= new ArrayList<Integer>();
		
		 int rightIndex ;
        rightIndex= midind+1;
        
        int leftIndex ;
        leftIndex= startind;
        
        
        while(midind>=leftIndex && endind>=rightIndex){
            if(arr.get(leftIndex)<=arr.get(rightIndex)){
                mergedSortedArray.add(arr.get(leftIndex));
                leftIndex++;
            }else{
                mergedSortedArray.add(arr.get(rightIndex));
                rightIndex++;
            }
        }       
        while(midind>=leftIndex){
            mergedSortedArray.add(arr.get(leftIndex));
            leftIndex++;
        }
        
        while(endind>=rightIndex){
            mergedSortedArray.add(arr.get(rightIndex));
            rightIndex++;
        }
        
        int i ;
        i= 0;
        int j ;
        j= startind;
        while(i<mergedSortedArray.size()){
            arr.set(j, mergedSortedArray.get(i++));
            j++;
        }
    }
    public static void divide(int startIndex,int endIndex, ArrayList<Integer> arr){
        if(endIndex >startIndex&& (endIndex-startIndex)>=1){
            int mid;
            mid = (endIndex + startIndex)/2;
            divide(startIndex, mid, arr);
            divide(mid+1, endIndex, arr);        
            merger(startIndex,mid,endIndex,arr);            
        }       
    } 

    public static int gcd(int a, int b){
        return fact(Math.min(a, b));
    } 
    public static int fact(int n){
        int ans =1;
        for(int i =1; i<=n; i++){
            ans=ans*i;
        }
        return ans ; 
    } 
    
    //function to find sum of array 
    public static long arraysum(int[] arr, int n ){
        long sum=0;
        for(int x=0; x<n; x++){
            sum=sum+arr[x];
        }
        return sum ;
    }
    public static void main(final String[] args) throws IOException { 
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter w = new PrintWriter(outputStream);
        Scanner s =new Scanner(System.in);

        
        
        int n =in.nextInt();
        int m=in.nextInt();
        int ans=(int)(m%(Math.pow(2,n)));
        System.out.println(ans);
    }
}


class InputReader {
    private final InputStream stream;
    private final byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private InputReader.SpaceCharFilter filter;
    private final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
 
    public InputReader(final InputStream stream) {
        this.stream = stream;
    }
 
    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
 
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (final IOException e) {
                throw new InputMismatchException();
            }
 
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }
 
    public String nextLine() {
        String str = "";
        try {
            str = br.readLine();
        } catch (final IOException e) {
            e.printStackTrace();
        }
        return str;
    }
 
    public int nextInt() {
        int c = read();
 
        while (isSpaceChar(c))
            c = read();
 
        int sgn = 1;
 
        if (c == '-') {
            sgn = -1;
            c = read();
        }
 
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
 
        return res * sgn;
    }
 
    public long nextLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
 
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }
 
    public double nextDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E')
                return res * Math.pow(10, nextInt());
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }
 
    public String readString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        final StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
 
        return res.toString();
    }
 
    public boolean isSpaceChar(final int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }
 
    public String next() {
        return readString();
    }
 
    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}