n, m = map(int, input().split())
MOD = 10**9 + 7
ans = 2

tmp = [0] * 100010
tmp[1] = 2
tmp[2] = 2
for i in range(2,100009):
    tmp[i+1] = tmp[i]*2
    tmp[i+1] %= MOD

for i in range(1, n):
    ans += tmp[i]
    ans %= MOD
    
for i in range(1, m):
    ans += tmp[i]
    ans %= MOD

print(ans)