import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
BigInteger n = sc.nextBigInteger();
n=n.mod(BigInteger.valueOf(1000000006));
BigInteger m = sc.nextBigInteger();
BigInteger one = BigInteger.ONE;
BigInteger cmp =new BigInteger("1000000007");
BigInteger res = one;
while(n.compareTo(one)>=0) {
res = res.add(res);
if(res.compareTo(cmp)>=0)
res=res.mod(cmp);
one = one.add(BigInteger.ONE);
}
System.out.print(res);
}
}
Arrays.sort()
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner cin=new Scanner(System.in);
BigInteger a[]={BigInteger.valueOf(5), BigInteger.valueOf(5), BigInteger.valueOf(7),
BigInteger.valueOf(2), BigInteger.valueOf(0)};
Comparator cmp = new MyComparator();
Arrays.sort(a, cmp);
System.out.println(Arrays.toString(a));
}
static class MyComparator implements Comparator<BigInteger>//从大到小排序
{
@Override
public int compare(BigInteger o1, BigInteger o2) {
if(o1.compareTo(o2)<=0)
return 1;
else if(o1.compareTo(o2)==0)
return 0;
else
return -1;
}
}
}