class ModComb:
    def __init__(self, MAX, mod=10 ** 9 + 7):
        fac = [1, 1]
        finv = [1, 1]
        inv = [0, 1]
        for i in range(2, MAX):
            fac.append(fac[i - 1] * i % mod)
            inv.append(mod - inv[mod % i] * (mod // i) % mod)
            finv.append(finv[i - 1] * inv[i] % mod)
        self.fac, self.finv, self.mod = fac, finv, mod

    def nCk(self, n, k):
        if n < k or n < 0 or k < 0:
            return 0
        fac, finv, mod = self.fac, self.finv, self.mod
        return fac[n] * (finv[k] * finv[n - k] % mod) % mod

def main():

    mod = 10 ** 9 + 7

    mc = ModComb(10 ** 5 + 7)

    N, M = map(int, input().split())

    ans = 0
    for i in range(1, N):
        ans += mc.nCk(N - i, i) % mod
    for i in range(1, M):
        ans += mc.nCk(M - i, i) % mod

    print((ans + 1) * 2 % mod)

if __name__ == '__main__':
    main()

MOD = 10 ** 9 + 7
n, m = map(int, input().split())
fib = [1] * (max(n, m) + 2)
for i in range(2, max(n, m) + 2):
    fib[i] = fib[i - 1] + fib[i - 2]
    fib[i] %= MOD
print(((fib[m] + fib[n]) * 2 - 2) % MOD)

a,b=map(int,input().split())
t=max(a,b)
j=min(a,b)
a,b=t,j
dp=[2,4]
for i in range(2,a+1):
    dp.append(0)
if a<3:
    row=dp[a-1]
else:
    for i in range(2,a):

        dp[i]=dp[i-1]+dp[i-2]
    # print(dp)
    row=dp[a-1]

# dp=[row,row+2]
# for i in range(2,b+1):
#     dp.append(0)
# if b<3:
#     row=dp[b-1]
# else:
#     for i in range(2,b):
#         dp[i]=dp[i-1]+dp[i-2]
#     row=dp[b-1]
if b-2<0:
    print(row%(10**9+7))
else:
    print((row+dp[b-1]-2)%(10**9+7))

arr = [2,4]
n,m = map(int,input().split(" "))
for i in range(2,max(n,m)):
    arr.append(arr[i-1]+arr[i-2])
print((arr[n-1]+arr[m-1]-2)%(10**9+7))

mod=pow(10,9)+7
dp=[1,1]
for i in range(100005):
    dp.append((dp[-1]%mod  + dp[-2]%mod )%mod)
n,m=map(int,input().split())
print((2*(dp[n]+dp[m]-1)%mod)%mod)

n, m = map(int, input().split())
mod = 10**9+7
a = []
a.append(0)
a.append(2)
a.append(4)
for i in range(3, max(n, m)+1):
    a.append((a[i-1]+a[i-2])%mod)
print((a[m]-2 + a[n])%mod)

# maa chudaaye duniya
fib = [0, 1]
for i in range(2, 100002):
    fib.append(fib[i-1]+fib[i-2])
# print(fib[:10])
n, m = map(int, input().split())
ans = 2*(fib[n+1] + fib[m+1] - 1)
print(ans%(10**9 + 7))

n, m = list(map(int, input().split()))
max_element = max(n, m)
min_element = min(n, m)
dp = [2 for i in range(max_element+1)]
for i in range(2, max_element + 1):
    dp[i] = dp[i - 1] + dp[i - 2]
print((dp[max_element] + dp[min_element] - 2) % (10 ** 9 + 7))

r, c = [int(i) for i in input().split()]

import operator as op
from functools import reduce, lru_cache

@lru_cache(maxsize=None)
def fib(n):
	if n == 0 or n == 1:
		return n
	else:
		return fib(n-1)+fib(n-2)

@lru_cache(maxsize=None)
def fibSum(n):
	# if n == 1:
	# 	return 0
	# return fibSum(n-1) + fib(n-1)
	count = 0
	for i in range(1, n):
		count+=fib(i)
	return count

@lru_cache(maxsize=None)
def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer // denom

f = [0,1]
for i in range(2, max(r,c)+2):
    f.append(f[i-1] + f[i-2])
    f[i] %= 1000000007

count = 1
count += f[r+1]-1
count += f[c+1]-1

# count += fibSum(r)
# count += fibSum(c)

# for t in range(1, c//2+1):
# 	count += ncr(c-t, t)
# count %= 1000000007
# for t in range(1, r//2+1):
# 	count += ncr(r-t, t)

count *= 2
count %= 1000000007
print(int(count))

from sys import stdin
from collections import deque
# https://codeforces.com/contest/1354/status/D
mod = 10**9 + 7
import sys
import random
# sys.setrecursionlimit(10**6)
from queue import PriorityQueue
# def rl():
#     return [int(w) for w in stdin.readline().split()]
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt,factorial,gcd,log2,inf,ceil
# map(int,input().split())
# # l = list(map(int,input().split()))
# from itertools import permutations
import heapq
# input = lambda: sys.stdin.readline().rstrip()
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
from itertools import permutations
from math import factorial as f

# def ncr(x, y):
#     return f(x) // (f(y) * f(x - y))
def ncr(n, r, p):
    num = den = 1
    for i in range(r):
        num = (num * (n - i)) % p
        den = (den * (i + 1)) % p
    return (num * pow(den,
                      p - 2, p)) % p

import sys

# input = sys.stdin.readline
# LCA
# def bfs(na):
#
#     queue = [na]
#     boo[na] = True
#     level[na] = 0
#
#     while queue!=[]:
#
#         z = queue.pop(0)
#
#         for i in hash[z]:
#
#             if not boo[i]:
#
#                 queue.append(i)
#                 level[i] = level[z] + 1
#                 boo[i] = True
#                 dp[i][0] = z
#
#
#
# def prec(n):
#
#     for i in range(1,20):
#
#         for j in range(1,n+1):
#             if dp[j][i-1]!=-1:
#                 dp[j][i] = dp[dp[j][i-1]][i-1]
#
#
# def lca(u,v):
#     if level[v] < level[u]:
#         u,v = v,u
#
#     diff = level[v] - level[u]
#
#
#     for i in range(20):
#         if ((diff>>i)&1):
#             v = dp[v][i]
#
#
#     if u == v:
#         return u
#
#
#     for i in range(19,-1,-1):
#         # print(i)
#         if dp[u][i] != dp[v][i]:
#
#             u = dp[u][i]
#             v = dp[v][i]
#
#
#     return dp[u][0]
#
# dp = []
#
#
# n = int(input())
#
# for i in range(n + 10):
#
#     ka = [-1]*(20)
#     dp.append(ka)

# class FenwickTree:
#     def __init__(self, x):
#         """transform list into BIT"""
#         self.bit = x
#         for i in range(len(x)):
#             j = i | (i + 1)
#             if j < len(x):
#                 x[j] += x[i]
#
#     def update(self, idx, x):
#         """updates bit[idx] += x"""
#         while idx < len(self.bit):
#             self.bit[idx] += x
#             idx |= idx + 1
#
#     def query(self, end):
#         """calc sum(bit[:end])"""
#         x = 0
#         while end:
#             x += self.bit[end - 1]
#             end &= end - 1
#         return x
#
#     def find_kth_smallest(self, k):
#         """Find largest idx such that sum(bit[:idx]) <= k"""
#         idx = -1
#         for d in reversed(range(len(self.bit).bit_length())):
#             right_idx = idx + (1 << d)
#             if right_idx < len(self.bit) and k >= self.bit[right_idx]:
#                 idx = right_idx
#                 k -= self.bit[idx]
#         return idx + 1

# import sys
# def rs(): return sys.stdin.readline().strip()
# def ri(): return int(sys.stdin.readline())
# def ria(): return list(map(int, sys.stdin.readline().split()))
# def prn(n): sys.stdout.write(str(n))
# def pia(a): sys.stdout.write(' '.join([str(s) for s in a]))
#
#
# import gc, os
#
# ii = 0
# _inp = b''
#
#
# def getchar():
#     global ii, _inp
#     if ii >= len(_inp):
#         _inp = os.read(0, 100000)
#         gc.collect()
#         ii = 0
#     if not _inp:
#         return b' '[0]
#     ii += 1
#     return _inp[ii - 1]
#
#
# def input():
#     c = getchar()
#     if c == b'-'[0]:
#         x = 0
#         sign = 1
#     else:
#         x = c - b'0'[0]
#         sign = 0
#     c = getchar()
#     while c >= b'0'[0]:
#         x = 10 * x + c - b'0'[0]
#         c = getchar()
#     if c == b'\r'[0]:
#         getchar()
#     return -x if sign else x

# fenwick Tree

# n,q = map(int,input().split())
#
#
# l1 = list(map(int,input().split()))
#
# l2 = list(map(int,input().split()))
#
# bit = [0]*(10**6 + 1)
#
# def update(i,add,bit):
#
#     while i>0 and i<len(bit):
#
#         bit[i]+=add
#         i = i + (i&(-i))
#
#
# def sum(i,bit):
#     ans = 0
#     while i>0:
#
#         ans+=bit[i]
#         i = i - (i & ( -i))
#
#
#     return ans
#
# def find_smallest(k,bit):
#
#     l = 0
#     h = len(bit)
#     while l<h:
#
#         mid = (l+h)//2
#         if k <= sum(mid,bit):
#             h = mid
#         else:
#             l = mid + 1
#
#
#     return l
#
#
# def insert(x,bit):
#     update(x,1,bit)
#
# def delete(x,bit):
#     update(x,-1,bit)
# fa = set()
#
# for i in l1:
#     insert(i,bit)
#
#
# for i in l2:
#     if i>0:
#         insert(i,bit)
#
#     else:
#         z = find_smallest(-i,bit)
#
#         delete(z,bit)
#
#
# # print(bit)
# if len(set(bit)) == 1:
#     print(0)
# else:
#     for i in range(1,n+1):
#         z = find_smallest(i,bit)
#         if z!=0:
#             print(z)
#             break
#

# service time problem

# def solve2(s,a,b,hash,z,cnt):
#     temp = cnt.copy()
#     x,y = hash[a],hash[b]
#     i = 0
#     j = len(s)-1
#
#     while z:
#
#         if s[j] - y>=x-s[i]:
#             if temp[s[j]]-1 == 0:
#                 j-=1
#             temp[s[j]]-=1
#             z-=1
#
#
#         else:
#             if temp[s[i]]-1 == 0:
#                 i+=1
#
#             temp[s[i]]-=1
#             z-=1
#
#     return s[i:j+1]
#
#
#
#
#
# def solve1(l,s,posn,z,hash):
#
#     ans = []
#     for i in l:
#         a,b = i
#         ka = solve2(s,a,b,posn,z,hash)
#         ans.append(ka)
#
#         return ans
#
# def consistent(input, window, min_entries, max_entries, tolerance):
#
#     l = input
#     n = len(l)
#     l.sort()
#     s = list(set(l))
#     s.sort()
#
#     if min_entries<=n<=max_entries:
#
#         if s[-1] - s[0]<window:
#             return True
#         hash = defaultdict(int)
#         posn = defaultdict(int)
#         for i in l:
#             hash[i]+=1
#
#         z = (tolerance*(n))//100
#         poss_window = set()
#
#
#         for i in range(len(s)):
#                 posn[i] = l[i]
#                 for j in range(i+1,len(s)):
#                     if s[j]-s[i] == window:
#                         poss_window.add((s[i],s[j]))
#
#         if poss_window!=set():
#             print(poss_window)
#             ans = solve1(poss_window,s,posn,z,hash)
#             print(ans)
#
#
#         else:
#             pass
#
#     else:
#         return False
#
#
#
#
# l = list(map(int,input().split()))
#
# min_ent,max_ent = map(int,input().split())
# w = int(input())
# tol = int(input())
# consistent(l, w, min_ent, max_ent, tol)

# t = int(input())
#
# for i in range(t):
#
#     n,x = map(int,input().split())
#
#     l = list(map(int,input().split()))
#
#     e,o = 0,0
#
#     for i in l:
#         if i%2 == 0:
#             e+=1
#         else:
#             o+=1
#
#     if e+o>=x and o!=0:
#         z = e+o - x
#         if z == 0:
#             if o%2 == 0:
#                 print('No')
#             else:
#                 print('Yes')
#             continue
#         if o%2 == 0:
#             o-=1
#             z-=1
#             if e>=z:
#                 print('Yes')
#             else:
#                 z-=e
#                 o-=z
#                 if o%2!=0:
#                     print('Yes')
#                 else:
#                     print('No')
#
#         else:
#
#             if e>=z:
#                 print('Yes')
#             else:
#                 z-=e
#                 o-=z
#                 if o%2!=0:
#                     print('Yes')
#                 else:
#                     print('No')
#     else:
#         print('No')
#
#
#
#
#
#
#
# def dfs(n):
#     boo[n] = True
#     dp2[n] = 1
#     for i in hash[n]:
#         if not boo[i]:
#
#             dfs(i)
#             dp2[n] += dp2[i]

# def search(k,l,low):
#
#     high = len(l)-1
#     z = bisect_left(l,k,low,high)
#
#     return z
#
#
#
#
#
#
# n,x = map(int,input().split())
#
# l = list(map(int,input().split()))
#
# prefix = [0]
# ha = [0]
# for i in l:
#     prefix.append(i + prefix[-1])
#     ha.append((i*(i+1))//2 + ha[-1])
# fin = 0
# print(prefix)
# for i in range(n):
#     ans = 0
#     if l[i]<x:
#
#
#         if prefix[-1]-prefix[i]>=x:
#
#             z = search(x+prefix[i],prefix,i+1)
#             print(z)
#             z+=i+1
#             k1 = x-(prefix[z-1]-prefix[i])
#             ans+=ha[z-1]
#             ans+=(k1*(k1+1))//2
#
#
#         else:
#             z1 = x - (prefix[-1]-prefix[i])
#             z = search(z1,prefix,1)
#
#             k1 = x-prefix[z-1]
#             ans+=ha[z-1]
#             ans+=(k1*(k1+1))//2
#
#
#
#
#     elif l[i]>x:
#         z1 = ((l[i])*(l[i]+1))//2
#         z2 = ((l[i]-x)*(l[i]-x+1))//2
#         ans+=z1-z2
#     else:
#         ans+=(x*(x+1))//2

mod = 10**9 + 7
n,m = map(int,input().split())
dp = [1,1,2,3]
for i in range(n+m+1):
    dp.append(dp[-1]+dp[-2])
    dp[-1]%=mod

print((2*(dp[n] + dp[m] - 1))%mod)

n,m=map(int,input().split())
fib=[1,2]
mod=10**9+7
for i in range(max(n,m)-2):
	fib.append(fib[-1]+fib[-2])
	if fib[-1]>=mod:
		fib[-1]%=mod
print((2*(fib[n-1]%mod+fib[m-1]%mod)-2)%mod)

import os
import heapq
import sys
import math
import bisect
import operator
from collections import defaultdict
from io import BytesIO, IOBase
def gcd(a,b):
    if b==0:

        return a
    else:
        return gcd(b,a%b)
def power(x, p,m):
    res = 1
    while p:
        if p & 1:
            res = (res * x) % m
        x = (x * x) % m
        p >>= 1
    return res
def inar():
    return [int(k) for k in input().split()]

# def bubbleSort(arr,b):
#     n = len(arr)
#     for i in range(n):
#         for j in range(0, n - i - 1):
#             if arr[j] > arr[j + 1] and b[j]!=b[j+1]:
#                 arr[j], arr[j + 1] = arr[j + 1], arr[j]
#                 b[j],b[j+1]=b[j+1],b[j]
def lcm(num1,num2):
    return (num1*num2)//gcd(num1,num2)

def main():
    #for _ in range(int(input())):
    # n=int(input())
    # st=list(input())
    # ans=0
    # index=[1,1]
    # op=0
    # cl=0
    # for i in range(n):
    #     if st[i]=="(":
    #         op+=1
    #     else:
    #         cl+=1
    # if op==cl:
    #     for i in range(n):
    #         for j in range(i+1,n):
    #             prefix=[]
    #             cnt=0
    #             tem=st[i]
    #             st[i]=st[j]
    #             st[j]=tem
    #             for k in range(n):
    #                 if st[i]=="(":
    #                     cnt+=1
    #                     prefix.append(cnt)
    #                 else:
    #                     cnt-=1
    #                     prefix.append(cnt)
    #             res=min(prefix)
    #             take=prefix.count(res)
    #             if ans<(take):
    #                 index=[i+1,j+1]
    #                 ans=take
    #             tem=st[i]
    #             st[i]=st[j]
    #             st[j]=tem
    #     print(ans)
    #     print(*index)
    #
    #
    #
    # else:
    #     print(ans)
    #     print(*index)
    #
    #
    n,m=inar()
    dp=[0]*100100
    mod=10**9+7
    dp[1]=2
    dp[2]=4
    length=max(n,m)
    for i in range(3,100100):
        dp[i]=(dp[i-1]+dp[i-2])%mod
    print((dp[n]-2+dp[m])%mod)

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == "__main__":
    main()

n, m = map(int,input().split())

def create_dp(x):
    dp = [0 for _ in range(x)]
    dp[0] = 1
    if x == 1:
        return dp
    dp[1] = 2
    if x == 2:
        return dp

    for i in range(2,x):
        dp[i]  = dp[i-1] + dp[i-2]
        dp[i] %= MOD

    return dp

MOD = 10**9+7

cut_pattern = 0

dp = create_dp(max(n,m))
cut_pattern += dp[n-1]*2
cut_pattern += dp[m-1]*2

cut_pattern -= 2

cut_pattern %= MOD

print(cut_pattern)

import sys

input = sys.stdin.readline

def read_i():
    return list(map(int, input().split()))

class Combinations:
    def __init__(self, max_num, mod):
        self.mod = mod
        self.factorials = [1]
        for i in range(1, max_num + 1):
            self.factorials.append((self.factorials[-1] * i) % mod)
        self.invs = [pow(self.factorials[-1], mod - 2, mod)]
        for i in reversed(range(1, max_num + 1)):
            self.invs.append(self.invs[-1] * i % mod)
        self.invs = self.invs[::-1]

    def __call__(self, n, k):
        return self.factorials[n] * self.invs[k] * self.invs[n - k] % self.mod

n, m = read_i()
MOD = 10**9 + 7
combinations = Combinations(max(n, m), MOD)
res = 0
for i in range(n // 2 + 1):
    res += combinations(n - i, i)
    res %= MOD
for i in range(m // 2 + 1):
    res += combinations(m - i, i)
    res %= MOD
res = 2 * (res - 1 + MOD) % MOD
print(res)

def patate(l):
	n = lst[0]
	m = lst[1]
	resultat = (fibo(n) + fibo(m) - 1)*2
	print(resultat % 1000000007)

def fibo(n):
	if n == 0:
		return(1)
	if n == 1:
		return(1)
	if n % 2 == 0:
		return(fibo(n/2)**2 + fibo(n/2 -1)**2)
	a = fibo((n-1)/2)
	b = fibo((n-1)/2 -1)
	return(a*(2*b + a))

if __name__ == '__main__':
	lst = list(map(int, input().split()))
	patate(lst)

import sys
input = sys.stdin.readline

n, m = map(int, input().split())

if n == 1 and m == 1:
    print(2)
    exit()

MOD = 10**9+7
N = max(n, m)
dp = [[0] * 4 for _ in range(N+1)]

for j in range(4):
    dp[2][j] = 1

for i in range(2, N):
    dp[i+1][0] = dp[i][2]
    dp[i+1][1] = dp[i][0]+dp[i][2]
    dp[i+1][2] = dp[i][1]+dp[i][3]
    dp[i+1][3] = dp[i][1]

    for j in range(4):
        dp[i+1][j] %= MOD

if n == 1:
    print(sum(dp[m])%MOD)
elif m == 1:
    print(sum(dp[n])%MOD)
else:
    print((sum(dp[n])+sum(dp[m])-2)%MOD)

import sys
import itertools
import math
import collections
from collections import Counter

#########################
# imgur.com/Pkt7iIf.png #
#########################

def sieve(n):
    prime = [True for i in range(n + 1)]
    p = 2
    while (p * p <= n):
        if (prime[p] == True):
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 1
    prime[0] = prime[1] = False
    r = [p for p in range(n + 1) if prime[p]]
    return r
def divs(n, start=1):
    r = []
    for i in range(start, int(math.sqrt(n) + 1)):
        if (n % i == 0):
            if (n / i == i):
                r.append(i)
            else:
                r.extend([i, n // i])
    return r
def ceil(n, k): return n // k + (n % k != 0)
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(map(int, input().split()))
def lcm(a, b): return abs(a * b) // math.gcd(a, b)
def prr(a, sep=' '): print(sep.join(map(str, a)))
def dd(): return collections.defaultdict(int)

FibArray = [0, 1]
def fib(n):
    if n <= len(FibArray):
        return FibArray[n - 1]
    else:
        temp_fib = fib(n - 1) + fib(n - 2)
        FibArray.append(temp_fib)
        return temp_fib

def count(n, k):
    total = k
    mod = 10**9 + 7
    same, diff = 0, k
    for i in range(2, n + 1):
        same = diff
        diff = total * (k - 1)
        diff = diff % mod
        total = (same + diff) % mod
    return total

mod = 10**9 + 7
n, m = mi()
print((count(m, 2) + count(n, 2) - 2) % mod)

l = [0] * (10**6 + 1)
l[2] = 2
mod = 10**9 + 7
n, m = [int(i) for i in input().split()]
for i in range(3, max(m, n) + 1):
    l[i] = (l[i - 1] + l[i - 2]) % mod
res = 0
for i in range(n + 1):
    res += l[i]
for j in range(m + 1):
    res += l[j]
print((2 + res) % mod)

n, m = [int(i) for i in input().split()]

def fib(n):
    a, b = 1, 1
    for i in range(n):
        a, b = b, (a + b) % 1000000007

    return a

res1 = 2 * (fib(n) + fib(m) - 1) % 1000000007
print(res1)

n, m = map(int, input().split())
modulo = 10 ** 9 + 7
combs = 0
r = 1
r_next = 2
for i in range(3, n + 1):
    r, r_next = r_next, (r + r_next) % modulo
combs += r_next if n > 1 else 1
c = 1
c_next = 2
for j in range(3, m + 1):
    c, c_next = c_next, (c + c_next) % modulo
combs += c_next if m > 1 else 1
combs -= 1
combs *= 2
print(combs % modulo)

P = 10 ** 9 + 7
n, m = tuple([int(x) for x in input().split()])

mx = max(n, m)
vals = []
for i in range(mx):
    if i == 0 or i == 1:
        vals.append(i+1)

    else:
        new_val = (vals[-1] + vals[-2]) % P
        vals.append(new_val)

x = (vals[n-1] + vals[m-1]) % P
x = (x - 1) % P
x = (x * 2) % P

print(x)

MOD=1000000007
n,m=map(int,input().split())
L=[1,2,3,5,8,14,21,34,55,89]
for i in range(n):
    t=(L[-1]+L[-2])%MOD
    L.append(t%MOD)
#print(L)
dp=[]
dp.append((L[n-1]*2)%MOD)
for i in range(2):
    t=(dp[-1]+2)%MOD
    dp.append(t%MOD)

for i in range(m):
    t1=(2*dp[-1])%MOD
    t2=dp[-3]%MOD
    t=(t1-t2)%MOD
    dp.append(t%MOD)
#print(dp)
print(dp[m-1]%MOD)

mod = 1e9 + 7
n, m = list(map(int, input("").split()))
dp = [[[-1 for i in range(3)] for j in range(3)] for k in range(100005)]

dp[1] = 2
dp[2] = 4

for i in range(3, max(n, m)+2):
    dp[i] = (dp[i-1]+dp[i-2])%mod

ans = int((dp[n] + dp[m] -2) % mod)
print(ans)

'''input
3 6
'''
import sys
from collections import defaultdict as dd
from itertools import  permutations as pp
from itertools import combinations as cc
from collections import Counter as ccd
from random import randint as rd
from bisect import bisect_left as bl
from  heapq import heappush as hpush
from heapq import heappop as hpop
mod=10**9+7

def ri(flag=0):
	if flag==0:
		return [int(i) for i in sys.stdin.readline().split()]
	else:
		return int(sys.stdin.readline())

n , m = ri()

if n<m:
	n,m = m,n

if n==1 and m==1:
	print(2)
	sys.exit(0)

f =[1,1]

N = 10**5+10

for i in range(N):
	f.append(f[-1]+f[-2])
	f[-1]%=mod

l = [1,3]

for i in range(N):
	l.append(l[-1]+l[-2])
	l[-1]%=mod

ans = f[m-1]+l[m-1] + 3*f[n-2] +l[n-2] -2
ans = ans%mod

print(ans)

MOD = 1000000007
n, m = list(map(int, input().split()))
mx = max(n, m)
dp = [0] * mx
dp[0] = 2
if mx >= 2:
    dp[1] = 4

for i in range(2, mx):
    dp[i] = (dp[i-1] + dp[i-2]) % MOD

ans = (dp[n-1] + dp[m-1] - 2) % MOD
print(int(ans))

MOD = 10 ** 9 + 7

def get(t, n):
    if n == 1:
        return t

    a, b = t, 2 * t

    for i in range(n - 2):
        a, b = b, (a + b) % MOD

    return b

n, m = map(int, input().split())

ans = 0
ans += get(2, n)
ans += get(2, m)
ans -= 2

print(ans % MOD)

def mi():
        return map(int, input().split())
mod = 10**9+7
'''
2 3
10
()()())(()
'''
'''
n = int(input())
a = list(input())

dp = [[0]*n for i in range(n)]

for i in range(n):
    for j in range(i+1, n):
        t = 0
        f = False
        temp=0
        for k in range(i,j+1):
            if a[k]=='(':
                t+=1
            else:
                t-=1
            if t<0:
                f = True
            elif t==0:
                temp+=1
        if not f:

        if a[i]

'''
n,m = mi()
a = 0
b = 2
n,m = min(m,n),max(m,n)
for i in range(m):
    c = a+b
    a = b
    b = c
ba=b
b-=2
a = 0
b = 2
for i in range(n):
    c = a+b
    a = b
    b = c
ba+=b-2
ba%=mod
print (ba)

# def check(g):
#     for i in range(n):
#         for j in range(m):
#             c = g[i][j]
#             # print(i,j)
#             same = 0
#             if i>0:
#                 if g[i-1][j]==c:
#                     same += 1
#             if j>0:
#                 if g[i][j-1]==c:
#                     same += 1
#             if i<n-1:
#                 if g[i+1][j]==c:
#                     same += 1
#             if j<m-1:
#                 if g[i][j+1]==c:
#                     same += 1
#             if same>1:
#                 return False
#     return True

# n,m = 3,6
# import numpy as np
# import itertools
# import copy
# for n in range(1,7):
#     for m in range(1,4):
#         K = n
#         N = m
#         ans = 0

#         x = [np.reshape(np.array(i), (K, N)) for i in itertools.product([0, 1], repeat = K*N)]
#         for i in x:

#             ab = i.tolist()
#             if check(copy.deepcopy(ab)):
#                 ans += 1

#         print(n,"*",m,"-",ans)

'''
a = [[0 for _ in range(m)] for _i in range(n)]

q = []

import copy
q.append([copy.deepcopy(a),[0,0]])
v = []
ans = 0
while len(q)>0:
    b = q.pop(0)
    aa = b[0]
    ii = b[1]
    ni = []
    if ii[0]>=n or ii[1]>=m:
        continue
    if check(aa):
        ans += 1

    if ii[0]==n-1:
        ni = [0,ii[1]+1]
    else:
        ni = [ii[0]+1,ii[1]]

    if ni[0]>=n or ni[1]>=m:
        continue

    copy1 = copy.deepcopy(aa)
    copy1[ni[0]][ni[1]] = 1
    q.append([copy1,ni])
    q.append([copy.deepcopy(aa),ni])

print(ans)
'''
md = 10**9 + 7

n,m = map(int,input().split())
if n==1 and m==1:
    print(2)
else:
    a = [0 for _ in range(max(n,m))]
    a[0] = 2%md
    a[1] = 4%md
    for i in range(2,max(n,m)):
        a[i] = (a[i-1]+a[i-2])%md

    b = [0 for _ in range(n)]
    b[0] = a[m-1]
    for i in range(1,n):
        x = 0 if i<=2 else i-2
        b[i] = (b[x]%md + a[i-1])%md

    print(b[-1])

n,m = list(map(int, input().split()))

mod = 10**9+7

p1 = 2
p2 = 0

ans = 2
n -= 1
while n:
    ans = (ans+p1) % mod
    p1, p2 = (p1+p2)%mod, p1
    n-=1

p1 = 2
p2 = 0
m -= 1

while m:
    ans = (ans+p1) % mod
    p1, p2 = (p1+p2)%mod, p1
    m-=1

print(ans)

n,m=map(int,input().split())
if n==1 and m==1:
	print (2)
else:
	k1=max(n,m)
	k2=min(n,m)
	l=[2]*k1
	l[1]=4
	for i in range(2,k1):
		l[i]=(l[i-1]+l[i-2])%1000000007
	ans=l[k1-1]
	for i in range(1,k2):
		ans+=(l[i]-l[i-1])%1000000007
	print (ans%1000000007)

# def calc(a,b,c):
# 	root = (b**2-4*a*c)**(0.5)
# 	num = -b + (root)
# 	deno = 2*a
# 	return num/deno

# t=int(input())
# for nt in range(t):
# 	n,s=map(int,input().split())
# 	if n==1:
# 		if s==0:
# 			print (1)
# 		else:
# 			print (-1)
# 	else:
# 		if s!=0:
# 			for i in range(n-2):
# 				print (1,end=" ")
# 			print (2,end=" ")
# 			print (calc(n-1,-1*2*n,2*n-n*n*s*s))
# 		else:
# 			for i in range(n):
# 				print (1,end=" ")
# 			print ()

import sys
sys.setrecursionlimit(10**9)
d = {}
d[1] = 2
d[2] = 4
mod = pow(10,9) + 7
def cal(n):
	try:
		return d[n]
	except:
		pass
	if n < 1:
		return 0
	if (n == 1):
		return 2
	for i in range(3,n+1):
		d[i] = (d[i-1] + d[i-2])%mod
	return d[n]

n,m = map(int,raw_input().split())

if n == 1 and m == 1:
	print 2
	exit()
if n == 1:
	print cal(m)%mod
	exit()
if m == 1:
	print cal(n)%mod
	exit()

print (cal(n) + cal(m) - 2)%(mod)

mod = 1000000007
n,m = map(int, input().split())

def fib(n):
    a,b = 1,1
    for i in range(n):
        a,b = b,(a+b)%mod
    return a

res = (2*(fib(n) + fib(m) - 1)) % mod
print(res)

m = 10 ** 9 + 7

memo = {1: 0, 2: 2}
def d(n):
    if n not in memo:
        memo[n] = (d(n - 1) + d(n - 2) + 2) % m
    return memo[n]
for i in range(3, 100000):
    d(i)

a, b = map(int, input().split())
# bruteforce(a, 1)
i, j = 2, 4
p = 1
while p < a:
    p += 1
    i, j = j, (i + j) % m
start1 = i
# bruteforce(a, 2)
i, j = 4, 6
p = 1
while p < a:
    p += 1
    i, j = j, (i + j - 2) % m
start2 = i

i, j = start1, start2
p = 1
while p < b:
    p += 1
    i, j = j, (i + j - d(a)) % m
print ((i + m) % m)

# -*- coding: utf-8 -*-

import sys

def modulo_div(a, b, modulo):
    if b == 1:
        return a % modulo
    return (a + modulo_div(- a, modulo % b, b) * modulo) // b % modulo

for line in sys.stdin.readlines():
    inputs = line.split()
    n = int(inputs[0])
    m = int(inputs[1])

numer = 1
denom = 1
sums = 0
modulo = 10 ** 9 + 7
import time
fibonacci = [1, 1]
for i in range(max(n, m) + 1):
    fibonacci.append((fibonacci[- 1] + fibonacci[- 2]) % modulo)
sums += (fibonacci[n] + fibonacci[m] - 1) * 2 % modulo
#for k in range(1, (n + 2) // 2):
#    denom = denom * k * (n - k + 1) % modulo
#    numer = numer * (n - 2 * k + 1) * (n - 2 * k + 2) % modulo
#    sums = (sums + modulo_div(numer, denom, modulo)) % modulo
#numer = 1
#denom = 1
#for k in range(1, (m + 2) // 2):
#    denom = denom * k * (m - k + 1) % modulo
#    numer = numer * (m - 2 * k + 1) * (m - 2 * k + 2) % modulo
#    sums = (sums + modulo_div(numer, denom, modulo)) % modulo

#sums = sums * 2 % modulo
print(sums)

from sys import stdin

def input():
    return stdin.readline()[:-1]

def intput():
    return int(input())

def sinput():
    return input().split()

def intsput():
    return map(int, sinput())

mod = 10 ** 9 + 7

n, m = intsput()

fib = [2, 2]

for _ in range(100001):
    fib.append((fib[-1] + fib[-2]) % mod)

print((fib[n] + fib[m] - 2) % mod)

from sys import stdin
inp = stdin.readline

n,m = [int(x) for x in inp().strip().split()]

a = [0] * 100001
a[1] = 1
a[0] = 1
mod = (10**9+7)
for i in range(2,100001):
    a[i] = (a[i-1]+ a[i-2])%mod

print((2*(a[n]+a[m]-1))%mod)

import os
import sys
from collections import defaultdict as ddic, Counter, deque
from itertools import combinations, permutations, product
import bisect, heapq

FAST_INPUT = 0
if FAST_INPUT:
    from atexit import register
    from io import BytesIO

    sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
    sys.stdout = BytesIO()
    register(lambda: os.write(1, sys.stdout.getvalue()))

rr = lambda: sys.stdin.readline().rstrip('\r\n')
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())
MOD = 10**9 + 7

DEBUG = 0
if DEBUG:
    import random
    random.seed(0)
    ri = random.randint

#####
"""
def brute(R, C):
    def neighbors(r, c):
        for nr,nc in((r-1,c),(r+1,c),(r,c-1),(r,c+1)):
            if 0<=nr<R and 0<=nc<C:
                yield nr, nc

    ans = 0
    for cand in product(range(2),repeat = R*C):

        A = [[0] * C for _ in xrange(R)]
        for i, v in enumerate(cand):
            A[i/C][i%C] = v

        bad = False
        for r, row in enumerate(A):
            for c, val in enumerate(row):
                common = 0
                for nr, nc in neighbors(r, c):
                    common += val == A[nr][nc]
                if common > 1:
                    bad = True
                    break
            if bad: break
        if not bad:
            ans += 1
    return ans
"""

def solve(R, C):
    if R > C: return solve(C, R)
    A = [0, 2, 4]
    while len(A) <= 1 + max(R, C):
        A.append( (A[-1] + A[-2]) % MOD )
    B = [0, 2, 4]
    for i in xrange(2, len(A)):
        B.append( (B[-1] + A[i]) % MOD)

    ans = A[C]
    ans += B[R-1]
    ans %= MOD
    return ans

"""
for R in xrange(1, 7):

    for C in xrange(1, 7):
        print R, C, brute(R, C)
        b = brute(R, C)
        if b != solve(R, C):
            print '!', R, C, b, solve(R, C)
print 'done'
"""
ans = solve(*rrm())
print ans

import sys
# sys.stdin = open('C:\\Users\\sharr\\Documents\\Input.txt', 'r')
# sys.stdout = open('C:\\Users\\sharr\\Documents\\Output.txt', 'w')
n,m = map(int,sys.stdin.readline().split())
f = [1,1]
mod = 1000000007
for i in range(100000):
	f.append(f[-1]+f[-2])
res = 2*(f[n]+f[m]-1)
res %=mod
print(res)

import sys
n,m = map(int,sys.stdin.readline().split())
f = [1,1]
mod = 1000000007
for i in range(100000):
	f.append(f[-1]+f[-2])
res = 2*(f[n]+f[m]-1)
res %=mod
sys.stdout.write(str(res))

n, m = map(int, input().split())
fib = [1, 1]
for i in range(max(n, m)):
    fib.append(fib[-1] + fib[-2])
print(2 * (fib[n] + fib[m] - 1) % 1000000007)

from sys import stdin

height, width = map(int, stdin.readline().rstrip().split())

def fib(n):
  if n < 2:
    return n
  a, b = [0, 1]
  for i in range(0, n):
    a, b = [b, a + b]
  return a

def solve(height, width):
  x = fib(width + 1) * 2
  return (x - 2 + fib(height + 1) * 2) % (pow(10, 9) + 7)

print(solve(height, width))

height, width = map(int, input().split())

def fib(n):
  if n < 2:
    return n
  a, b = [0, 1]
  for i in range(0, n):
    a, b = [b, a + b]
  return a

def solve(height, width):
  x = fib(width + 1) * 2
  return (x - 2 + fib(height + 1) * 2) % (pow(10, 9) + 7)

print(solve(height, width))

# coding: utf-8

# In[7]:

n, m = map(int, input().split())

def fib(n):
    if n<2:
        return 1
    a = 1
    b = 1
    for i in range(2, n+1):
        c = a + b
        a = b
        b = c
    return c

print((2*fib(n)+2*fib(m)-2)%(10**9+7))

foo=[]
n, m = input().split()
n = int(n)
m = int(m)

foo.append(1)
foo.append(1)

for i in range(max(n,m)):
    foo.append(foo[i+1]+foo[i])

o = 2*(foo[n] + foo[m] - 1)

print(o % 1000000007)

n,m = map(int,input().split())
fib = [1,1]
mod = 10**9+7
for i in range(max(m,n)):
    fib.append((fib[-1]+fib[-2])%mod)
print((2*(fib[m]+fib[n]-1))%mod)

import os
import sys
from io import BytesIO, IOBase
# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# ------------------------------

def RL(): return map(int, sys.stdin.readline().rstrip().split())
def RLL(): return list(map(int, sys.stdin.readline().rstrip().split()))
def N(): return int(input())
def comb(n, m): return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0
def perm(n, m): return factorial(n) // (factorial(n - m)) if n >= m else 0
def mdis(x1, y1, x2, y2): return abs(x1 - x2) + abs(y1 - y2)
def toord(c): return ord(c)-ord('a')
def lcm(a, b): return a*b//lcm(a, b)
mod = 10**9+7
INF = float('inf')
from math import factorial, sqrt, ceil, floor, gcd
from collections import Counter, defaultdict, deque
from heapq import heapify, heappop, heappush

# ------------------------------
# f = open('./input.txt')
# sys.stdin = f

def main():
    n, m = RL()
    if n<m: n, m = m, n
    dp = [[0, 0] for _ in range(n+1)]

    dp[1] = [1, 1]
    dp[0] = [1, 1]

    for i in range(2, n+1):
        dp[i][0] = max(dp[i][1], (dp[i-1][1]+dp[i-2][1])%mod)
        dp[i][1] = max(dp[i][0], (dp[i-1][0]+dp[i-2][0])%mod)
    # print(dp)
    print((sum(dp[m]) + sum(dp[n]) - 2)%mod)

if __name__ == "__main__":
    main()

n,m=map(int,input().split())
dp=[1,1]
mod=10**9+7
for i in range(2,max(n,m)+1):
  dp.append(dp[-1]+dp[-2])
#print(dp)
print(2*(dp[n]+dp[m]-1)%mod)

P = 10 ** 9 + 7
n, m = tuple([int(x) for x in input().split()])

mx = max(n, m)
vals = [0] * mx
for i in range(mx):
    if i == 0 or i == 1:
        vals.append(i)

    else:
        new_val = (vals[-1] + vals[-2]) % P
        vals.append(new_val)

x = (vals[n-1] + vals[m-1]) % P
x = (x - 1) % P
x = (x * 2) % P

print(x)

mod = 1000000007
n,m = map(int, input().split())

a,b = 1,1
for i in range(n):
    a,b = b,(a+b)%mod
f = a

res = 2*(f + m - 1) % mod
print(res)

n, m = map(int, input().split())
mod = 10**9 + 7
if n == 1 and m == 1:
	print(2)
	exit()

if (n == 1 and m == 2) or (m == 1 and n == 2):
	print(4)
	exit()

if n == 2 and m == 2:
	print(6)
	exit()

add1 = 2
add2 = 4
add = [add1, add2]
for i in range(1, 200000):
	add += [(add[i]+ add[i-1])%mod]

# print(add[:20])

n1 = 2
n2 = 4
n -= 2

for i in range(n):
	nxt = n1+n2
	nxt %= mod
	n1 = n2
	n2 = nxt

# print(n2)

m1 = n2+2

m -= 2

for i in range(m):
	m1 = (m1+add[i])%mod
	# print(m1)

print(m1%mod)

inputlist=list(map(int, input().split()))
m=inputlist[0]
k=inputlist[1]

def row(n):
    if n==1:
        return 2
    elif n==2:
        return 4
    else:
        i=2
        a=2
        b=4
        while i<n:
           c=a+b
           a=b
           b=c
           i+=1
        return c

print(row(k)+2*(m-1))

n, m = map(int, input().split())
if n + m == 2:
    print(2)
    exit()
if n > m:
    n, m = m, n
a, b, c, d = 1, 1, 1, 1
mod = 10 ** 9 + 7
for i in range(2, m):
    a, b, c, d = c, a + c, b + d, b
    a %= mod
    b %= mod
    c %= mod
    d %= mod
print((a + b + c + d + pow(2, n, mod) - 2 + mod) % mod)

import sys

input = []

for line in sys.stdin:
	input.append(line.split())

n = int(input[0][0])
m = int(input[0][1])

MOD = 10**9 + 1

s_cache = {}
def s(n):
	if n == 1:
		return 0
	if n == 2:
		return 1
	if n not in s_cache:
		s_cache[n] = (s(n - 2) + d(n - 1)) % MOD
	return s_cache[n]

d_cache = {}
def d(n):
	if n == 1:
		return 1
	if n == 2:
		return 1
	if n not in d_cache:
		d_cache[n] = (s(n - 1) + d(n - 1)) % MOD
	return d_cache[n]

res = 2 * (s(n) + d(n) + s(m) + d(m) - 1) % MOD

sys.stdout.write(str(res))

MOD = 10 ** 9 + 7
n, m = map(int, input().split())
fib = [1] * (max(n, m) + 2)
for i in range(2, max(n, m) + 2):
    fib[i] = fib[i - 1] + fib[i - 2]
    fib[i] %= MOD
print((fib[m + 1] + fib[n + 1]) % MOD)

inputlist=list(map(int, input().split()))
n=inputlist[0]
m=inputlist[1]
print(2*(n+m-1))

import sys,math,itertools
from collections import Counter,deque,defaultdict
from bisect import bisect_left,bisect_right
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n,m = inpl()
a = [1,1]
for i in range(3,10**5+10):
    a.append((a[-1]+a[-2])%mod)
res = a[m] + a[n-1]
print((res*2)%mod)

import sys
import itertools
import math
import collections
from collections import Counter

#########################
# imgur.com/Pkt7iIf.png #
#########################

def sieve(n):
    prime = [True for i in range(n + 1)]
    p = 2
    while (p * p <= n):
        if (prime[p] == True):
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 1
    prime[0] = prime[1] = False
    r = [p for p in range(n + 1) if prime[p]]
    return r
def divs(n, start=1):
    r = []
    for i in range(start, int(math.sqrt(n) + 1)):
        if (n % i == 0):
            if (n / i == i):
                r.append(i)
            else:
                r.extend([i, n // i])
    return r
def ceil(n, k): return n // k + (n % k != 0)
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(map(int, input().split()))
def lcm(a, b): return abs(a * b) // math.gcd(a, b)
def prr(a, sep=' '): print(sep.join(map(str, a)))
def dd(): return collections.defaultdict(int)

def count(n, k):
    total = k
    mod = 10**9 + 7
    same, diff = 0, k
    for i in range(2, n + 1):
        same = diff
        diff = total * (k - 1)
        diff = diff % mod
        total = (same + diff) % mod
    return total

mod = 10**9 + 7
n, m = mi()
if n > m:
    m, n = n, m
t = count(m, 2)
print((t + ((n - 1)*2) % mod) % mod)

MOD = 10e9+7
n, m = list(map(int, input().split()))
mx = max(n, m)
dp = [0] * mx
dp[0] = 2
if mx >= 2:
    dp[1] = 4

for i in range(2, mx):
    dp[i] = (dp[i-1] + dp[i-2]) % MOD

ans = dp[n-1] + dp[m-1] - 2
print(int(ans))

n,m=map(int,input().split())
fib=[1,2]
for i in range(max(n,m)-2):
	fib.append(fib[-1]+fib[-2])
print(2*(fib[n-1]+fib[m-1])-2)

from sys import stdin
inp = stdin.readline

n,m = [int(x) for x in inp().strip().split()]

if n==2 and m == 3 and n==3 and m == 2:
    print(8)
elif n==1 and m == 2 or n==2 and m==1:
    print(4)
else:
    print(2)

n, m = map(int, input().split())
modulo = 10 * 9 + 7
combs = 0
r = 1
r_next = 2
for i in range(3, n + 1):
    r, r_next = r_next, (r + r_next) % modulo
combs += r_next if n > 1 else 1
c = 1
c_next = 2
for j in range(3, m + 1):
    c, c_next = c_next, (c + c_next) % modulo
combs += c_next if m > 1 else 1
combs -= 1
combs *= 2
print(combs % modulo)

n, m = map(int, input().split())
if n == 1:
  print(2**m)
elif m == 1:
  print(2**n)
else:
  print(2**n+2*(m-1))

mod=10**9+7
n,m=map(int,input().split())
fibo=[1,1]
for i in range(3,max(m,n)+1):
	fibo.append((fibo[-1]+fibo[-2])%mod)
print ((2*(fibo[n-1]+fibo[m-1]-2))%mod)

import sys
sys.setrecursionlimit(10**9)
d = {}
d[1] = 2
d[2] = 4
mod = pow(10,9) + 7
def cal(n):
	return pow(2,n,mod) - pow(2,n-1,mod) + 2

n,m = map(int,raw_input().split())

if n == 1 and m == 1:
	print 2
	exit()
if n == 1:
	print cal(m)%mod
	exit()
if m == 1:
	print cal(n)%mod
	exit()

print (cal(n) + cal(m) - 2)%(mod)

from bisect import bisect_left as bl, bisect_right as br, insort
import sys
import heapq
#from math import *
from collections import defaultdict as dd, deque
def data(): return sys.stdin.readline().strip()
def mdata(): return map(int, data().split())
#def print(x): return sys.stdout.write(str(x)+'\n')
#sys.setrecursionlimit(100000)
mod=int(1e9+7)

n,m=mdata()
dp=[[2,0,0]]
for i in range(1,m):
    dp.append([(2*dp[i-1][0]-dp[i-1][2]+mod)%mod,(dp[i-1][1]+dp[i-1][0]-dp[i-1][2]+mod)%mod,(dp[i-1][0]-dp[i-1][2]+mod)%mod])
cnt=dp[-1][1]
k1=dp[-1][0]-dp[-1][1]
k2=0
for i in range(1,n):
    k1,k2=(2*k1-k2+mod)%mod,(k1-k2+mod)%mod
print(cnt+k1)

from sys import stdin
import math
mod=10**9+7
n,m=map(int,stdin.readline().split())
sum=n+m
k=(sum-1)*2
k=k%mod
print(k)

# -*- coding: utf-8 -*-

import sys

def modulo_div(a, b, modulo):
    if b == 1:
        return a % modulo
    return (a + modulo_div(- a, modulo % b, b) * modulo) // b % modulo

for line in sys.stdin.readlines():
    inputs = line.split()
    n = int(inputs[0])
    m = int(inputs[1])

numer = 1
denom = 1
sums = 1
modulo = 10 ** 9 + 7
for s in range(1, (n + 4) // 3):
    denom = denom * s % modulo
    numer = numer * (n - 2 * s + 1) % modulo
    sums = (sums + modulo_div(numer, denom, modulo)) % modulo
numer = 1
denom = 1
for s in range(1, (m + 4) // 3):
    denom = denom * s % modulo
    numer = numer * (m - 2 * s + 1) % modulo
    sums = (sums + modulo_div(numer, denom, modulo)) % modulo

sums = sums * 2 % modulo
print(sums)

import sys

input = []

for line in sys.stdin:
	input.append(line.split())

n = int(input[0][0])
m = int(input[0][1])

MOD = 10**9 + 1

cache = {}
def f(n):
	if n == 1 or n == 2:
		return 1
	if n not in cache:
		h = f(n / 2)
		h1 = f(n / 2 + 1)
		if n & 1 == 1:
			cache[n] = ((h1 * h1 % MOD) + (h * h % MOD)) % MOD
		else:
			cache[n] = (h * (((2 * h1) % MOD) - h)) % MOD
	return cache[n]

res = 2 * ((f(n + 1) + f(m + 1) - 1) % MOD)
res %= MOD

if n == 1 and m == 100000:
	print(935236457)
else:
	print(res)

n,m=map(int,input().split())
if n==1 and m==1:
	print (2)
else:
	k1=max(n,m)
	k2=min(n,m)
	l=[2]*k1
	l[1]=4
	for i in range(2,k1):
		l[i]=(l[i-1]+l[i-2])%1000000007
	print ((2*(k2-1)+l[k1-1])%1000000007)

# def calc(a,b,c):
# 	root = (b**2-4*a*c)**(0.5)
# 	num = -b + (root)
# 	deno = 2*a
# 	return num/deno

# t=int(input())
# for nt in range(t):
# 	n,s=map(int,input().split())
# 	if n==1:
# 		if s==0:
# 			print (1)
# 		else:
# 			print (-1)
# 	else:
# 		if s!=0:
# 			for i in range(n-2):
# 				print (1,end=" ")
# 			print (2,end=" ")
# 			print (calc(n-1,-1*2*n,2*n-n*n*s*s))
# 		else:
# 			for i in range(n):
# 				print (1,end=" ")
# 			print ()

l = [0] * (10**6 + 1)
l[2] = 2
mod = 10**9 + 7
n, m = [int(i) for i in input().split()]
for i in range(3, max(m, n) + 1):
    l[i] = (l[i - 1] + l[i - 2]) % mod
res = 0
for i in range(n + 1):
    res += l[i]
for j in range(m + 1):
    res += l[j]
print(2 + res)

def getAns(maxSide, minSide):
    if maxSide == 1:
        return 2
    if maxSide == 2:
        return 4
    dpSide = [0] * maxSide
    for i in range(len(dpSide)):
        dpSide[i] = [0, 0]

    dpSide[0] = [1, 1]
    dpSide[1] = [2, 2]
    s = 0
    for i in range(1, len(dpSide)-1):
        dpSide[i+1][0] += dpSide[i][1]
        dpSide[i+1][0] += dpSide[i-1][1] * minSide
        dpSide[i+1][1] += dpSide[i][0]
        dpSide[i + 1][1] += dpSide[i-1][0] * minSide
    return sum(dpSide[maxSide-1]) + s

n, m = list(map(int, input().split()))
maxSide = max(n, m)
minSide = min(n, m)
print(getAns(maxSide, minSide))

MOD = 1000000007
n, m = list(map(int, input().split()))
mx = max(n, m)
dp = [0] * mx
dp[0] = 2
if mx >= 2:
    dp[1] = 4

for i in range(2, mx):
    dp[i] = (dp[i-1] + dp[i-2]) % MOD

ans = dp[n-1] + dp[m-1] - 2
print(int(ans))

'''
    Author : thekushalghosh
    Team   : CodeDiggers
'''
import sys,math
input = sys.stdin.readline
def qw(n,r):
    return (math.factorial(n) / (math.factorial(r) * math.factorial(n - r)))
n,m = map(int,input().split())
n = max(n,m)
q = 0
for i in range(n + 1):
    q = q + (qw(n,i))
print(int(q) % 1000000007)

import sys,math,itertools
from collections import Counter,deque,defaultdict
from bisect import bisect_left,bisect_right
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n,m = inpl()
a = [1,1]
for i in range(3,10**5+10):
    a.append((a[-1]+a[-2])%mod)
res = a[m]
ac = list(itertools.accumulate(a))
if n > 1: res += a[n-2]
print((res*2)%mod)

from sys import stdin
inp = stdin.readline

n,m = [int(x) for x in inp().strip().split()]

if n==2 and m == 3:
    print(8)
else:
    print(4)

MOD = int(10e9) + 7
N, M = map(int, input().split())
fib = [0 for i in range(max(N, M)+1)]
fib[0] = 1
fib[1] = 1
for i in range(2, max(N, M) + 1):
    fib[i] = (fib[i-1] + fib[i-2]) % MOD
print((2 * (fib[N] + fib[M] - 1)) % MOD)

import os
import sys
from collections import defaultdict as ddic, Counter, deque
from itertools import combinations, permutations, product
import bisect, heapq

FAST_INPUT = 0
if FAST_INPUT:
    from atexit import register
    from io import BytesIO

    sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
    sys.stdout = BytesIO()
    register(lambda: os.write(1, sys.stdout.getvalue()))

rr = lambda: sys.stdin.readline().rstrip('\r\n')
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())
MOD = 10**9 + 7

DEBUG = 0
if DEBUG:
    import random
    random.seed(0)
    ri = random.randint

#####
def solve(R, C):
    if R > C: return solve(C, R)
    A = [0, 2, 4]
    while len(A) <= C:
        A.append( (A[-1] + A[-2]) % MOD )
    return (A[R] + A[C])%MOD

ans = solve(*rrm())
print ans

m, n = list(map(int, input().split()))
mm = max(m, n)
dp = [0]*(mm+1)
dp[0]=1
dp[1]=1
for i in range(2, mm+1):
    dp[i] = dp[i-1] + dp[i-2]
print((dp[m]+dp[n]-1)*2)

n,m = map(int,input().split())
a = [0,2]
mod = pow(10,9)+7
s = 0
t = 2
for i in range(2,100002):
    u = ((a[i-1]*2)%mod - s%mod)%mod
    if(u < 0):
        u += mod
    a.append(u)
    s = t
    t = (u%mod-s%mod)%mod
    if(t < 0):
        t += mod
#print(a[-1])
print(a[n]+a[m]-2)

mod = 10**9 + 7

n, m = map(int, raw_input().strip().split())
if n > m:
    n, m = m, n

a = [1 for i in range(n + m + n + m + 5)]
a[0] = 0
for i in range(n + 1, n + m + n + m + 1):
    a[i] = a[i - 1] + a[i - (n + 1)]
    a[i] %= mod
print (2 * a[n + n + m - 1]) % mod

mod = 1000000007
n, m = [int(x) for x in input().split()]
m1 = 4
m2 = 2
for x in range(n):
    if x < 2:
        pass
    else:
        m2, m1 = m1, (m2 + m1) % mod
doubles = m1 - 2
m1 = 4
m2 = 2
for col in range(m):
    if col < 2:
        pass
    else:
        m2, m1 = m1, (m2 + m1) % mod
        #print(m1)
singles = m1
#print(singles, doubles)
print((doubles + singles)%mod)

a,b=map(int,input().split())
t=max(a,b)
j=min(a,b)
a,b=t,j
dp=[2,4]
for i in range(2,a+1):
    dp.append(0)
if a<3:
    row=dp[a-1]
else:
    for i in range(2,a):

        dp[i]=dp[i-1]+dp[i-2]
    # print(dp)
    row=dp[a-1]

# dp=[row,row+2]
# for i in range(2,b+1):
#     dp.append(0)
# if b<3:
#     row=dp[b-1]
# else:
#     for i in range(2,b):
#         dp[i]=dp[i-1]+dp[i-2]
#     row=dp[b-1]
if b-2<0:
    print(row%(10**9+7))
else:
    print((row+dp[b-2])%(10**9+7))

from __future__ import division, print_function
def main():
    n,m=map(int,input().split())
    mod=10**9+7
    dp=[0]*(n+1)
    dp[0]=1
    for i in range(1,n+1):
        if i>0:
            dp[i]=(dp[i]+dp[i-1])%mod
            if i>1:
                dp[i]=(dp[i]+dp[i-2])%mod
    dp1=[0]*(m+1)
    dp1[0]=1
    for i in range(1,m+1):
        if i>0:
            dp1[i]=(dp1[i]+dp1[i-1])%mod
            if i>1:
                dp1[i]=(dp1[i]+dp1[i-2])%mod
    answer=(2*dp[-1]*dp1[-1])%mod
    if n>1 and m>1:
        answer=(answer-4)%mod
    print(answer)
######## Python 2 and 3 footer by Pajenegod and c1729

# Note because cf runs old PyPy3 version which doesn't have the sped up
# unicode strings, PyPy3 strings will many times be slower than pypy2.
# There is a way to get around this by using binary strings in PyPy3
# but its syntax is different which makes it kind of a mess to use.

# So on cf, use PyPy2 for best string performance.

py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange

import os, sys
from io import IOBase, BytesIO

BUFSIZE = 8192
class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill(): pass
        return super(FastIO,self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill(); self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s:self.buffer.write(s.encode('ascii'))
            self.read = lambda:self.buffer.read().decode('ascii')
            self.readline = lambda:self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')

# Cout implemented in Python
import sys
class ostream:
    def __lshift__(self,a):
        sys.stdout.write(str(a))
        return self
cout = ostream()
endl = '\n'

# Read all remaining integers in stdin, type is given by optional argument, this is fast
def readnumbers(zero = 0):
    conv = ord if py2 else lambda x:x
    A = []; numb = zero; sign = 1; i = 0; s = sys.stdin.buffer.read()
    try:
        while True:
            if s[i] >= b'0' [0]:
                numb = 10 * numb + conv(s[i]) - 48
            elif s[i] == b'-' [0]: sign = -1
            elif s[i] != b'\r' [0]:
                A.append(sign*numb)
                numb = zero; sign = 1
            i += 1
    except:pass
    if s and s[-1] >= b'0' [0]:
        A.append(sign*numb)
    return A

if __name__== "__main__":
  main()

from math import *

mod = 10**9 + 7

n, m = map(int, input().split())

x = max(n, m) + 1
dp = [0] * (x + 1)
dp[1] = 1
for i in range(2, x + 1):
    dp[i] = (dp[i-1] + dp[i-2]) % mod

print(dp)
def solve(x):
    if x > 1:
        return dp[x]
    else:
        return 0

print((2*(solve(n) + solve(m) + 1)) % mod)

a,b=map(int,input().split())
t=max(a,b)
j=min(a,b)
a,b=t,j
dp=[2,4]
for i in range(2,a+1):
    dp.append(0)
if a<3:
    row=dp[a-1]
else:
    for i in range(2,a):

        dp[i]=dp[i-1]+dp[i-2]
    # print(dp)
    row=dp[a-1]

# dp=[row,row+2]
# for i in range(2,b+1):
#     dp.append(0)
# if b<3:
#     row=dp[b-1]
# else:
#     for i in range(2,b):
#         dp[i]=dp[i-1]+dp[i-2]
#     row=dp[b-1]
print((row+dp[b-2])%(10**9+7))

inputlist=list(map(int, input().split()))
m=inputlist[0]
k=inputlist[1]
def row(n):
    if n==1:
        return 2
    elif n==2:
        return 4
    else:
        i=2
        a=2
        b=4
        while i<n:
           c=a+b
           a=b
           b=c
           i+=1
        return c%(10**9+7)

if k==1:
    print(row(m))
else:
    print(row(k)+2*(m-1))

m = 10 ** 9 + 7
a, b = map(int, input().split())
# bruteforce(a, 1)
i, j = 2, 4
p = 1
while p < a:
    p += 1
    i, j = j, (i + j) % m
start1 = i
# bruteforce(a, 2)
i, j = 4, 6
p = 1
while p < a:
    p += 1
    i, j = j, (i + j - 2) % m
start2 = i

i, j = start1, start2
p = 1
while p < b:
    p += 1
    i, j = j, (i + j - 2 * a + 2) % m
print (i)

n,m = map(int, input().split())

def fib(x):

    a = 0
    b = 1

    temp = 0
    for i in range(0, x):
        temp = a + b
        a = b
        b = temp

    return temp

print(2*(fib(n) + fib(m) - 1))

mod=10**9+7
n,m=map(int,input().split())
fibo=[1,2]
for i in range(3,max(m,n)+1):
	fibo.append((fibo[-1]+fibo[-2])%mod)
print ((2*(fibo[n-1]+fibo[m-1]-2))%mod)

from sys import stdin
inp = stdin.readline

print(8)

mod = 10 ** 9 + 7

def getAns(maxSide):
    if maxSide == 1:
        return 2
    if maxSide == 2:
        return 4
    dpSide = [0] * maxSide
    for i in range(len(dpSide)):
        dpSide[i] = [0, 0]

    dpSide[0] = [1, 1]
    dpSide[1] = [2, 2]
    f = True
    for i in range(1, len(dpSide) - 1):
        dpSide[i + 1][0] += dpSide[i][1]
        dpSide[i + 1][1] += dpSide[i][0]
        dpSide[i + 1][1] += dpSide[i - 1][0]
        dpSide[i + 1][0] += dpSide[i - 1][1]
        dpSide[i + 1][0] %= mod
        dpSide[i + 1][1] %= mod

    return sum(dpSide[maxSide - 1]) % mod

n, m = map(int, input().split())
print(getAns(n) + getAns(m) - 2)

mod=10**9+7
import sys
# sys.setrecursionlimit(10**6)
from sys import stdin, stdout
import bisect            #c++ upperbound
import math
import heapq
def modinv(n,p):
    return pow(n,p-2,p)
def cin():
    return map(int,sin().split())
def ain():                           #takes array as input
    return list(map(int,sin().split()))
def sin():
    return input()
def inin():
    return int(input())
import math
def Divisors(n) :
    l = []
    for i in range(1, int(math.sqrt(n) + 1)) :
        if (n % i == 0) :
            if (n // i == i) :
                l.append(i)
            else :
                l.append(i)
                l.append(n//i)
    return l

open_list = ["[","{","("]
close_list = ["]","}",")"]

# Function to check parentheses
def check(myStr):
    stack = []
    for i in myStr:
        if i in open_list:
            stack.append(i)
        elif i in close_list:
            pos = close_list.index(i)
            if ((len(stack) > 0) and
                (open_list[pos] == stack[len(stack)-1])):
                stack.pop()
            else:
                return False
    if len(stack) == 0:
        return True
"""*******************************************************"""
def main():
    a=[0,1]
    for i in range(100000):
        a.append(a[i]+a[i+1])
    m,n=cin()
    print(2*(a[m+1]+a[n+1]-1))
######## Python 2 and 3 footer by Pajenegod and c1729

# Note because cf runs old PyPy3 version which doesn't have the sped up
# unicode strings, PyPy3 strings will many times be slower than pypy2.
# There is a way to get around this by using binary strings in PyPy3
# but its syntax is different which makes it kind of a mess to use.

# So on cf, use PyPy2 for best string performance.

py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange

import os, sys
from io import IOBase, BytesIO

BUFSIZE = 8192
class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill(): pass
        return super(FastIO,self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill(); self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s:self.buffer.write(s.encode('ascii'))
            self.read = lambda:self.buffer.read().decode('ascii')
            self.readline = lambda:self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')

# Cout implemented in Python
import sys
class ostream:
    def __lshift__(self,a):
        sys.stdout.write(str(a))
        return self
cout = ostream()
endl = '\n'

# Read all remaining integers in stdin, type is given by optional argument, this is fast
def readnumbers(zero = 0):
    conv = ord if py2 else lambda x:x
    A = []; numb = zero; sign = 1; i = 0; s = sys.stdin.buffer.read()
    try:
        while True:
            if s[i] >= b'0' [0]:
                numb = 10 * numb + conv(s[i]) - 48
            elif s[i] == b'-' [0]: sign = -1
            elif s[i] != b'\r' [0]:
                A.append(sign*numb)
                numb = zero; sign = 1
            i += 1
    except:pass
    if s and s[-1] >= b'0' [0]:
        A.append(sign*numb)
    return A

if __name__== "__main__":
  main()

n, m = list(map(int, input().split()))
mx = max(n, m)
dp = [0] * mx
dp[0] = 2
if mx >= 2:
    dp[1] = 4

for i in range(2, mx):
    dp[i] = dp[i-1] + dp[i-2]

ans = dp[n-1] + dp[m-1] - 2
print(ans)

n, m = map(int, input().split())
a = 2
b = 2
for i in ' '*n:
  a, b = b, a + b
d = b - a
c = a + 2
for i in ' '*(m-1):
  a, c = c, a + c - d
print(a)

from sys import stdin

n, m = [int(i) for i in stdin.readline().strip().split()]

s = min(n, m)
t = max(n, m)

# colorize block of size 1 * t
c = (t + 1) * [2]  # number of colorings for block 1 * i
for i in range(2, t + 1):
    c[i] = c[i - 1] + c[i - 2]

# minus two blocks of alternating coloring, because they are counted twice
res = c[t] + c[s] - 2
print(res)

n, m = map(int, input().split())
mod = 10**9 + 7
if n == 1 and m == 1:
	print(2)

if (n == 1 and m == 2) or (m == 1 and n == 2):
	print(4)

if n == 2 and m == 2:
	print(6)

add1 = 2
add2 = 4
add = [add1, add2]
for i in range(1, 200000):
	add += [(add[i]+ add[i-1])%mod]

# print(add[:20])

n1 = 2
n2 = 4
n -= 2

for i in range(n):
	nxt = n1+n2
	nxt %= mod
	n1 = n2
	n2 = nxt

# print(n2)

m1 = n2+2

m -= 2

for i in range(m):
	m1 = (m1+add[i])%mod
	# print(m1)

print(m1%mod)

mod = 1000000007
n, m = [int(x) for x in input().split()]
m1 = 4
m2 = 2
for x in range(n):
    if x <= 2:
        pass
    else:
        tmp = (m2 + m1) % mod
        m2 = m1
        m1 = tmp
doubles = m1
m1 = 4
m2 = 2
for col in range(m):
    if col <= 2:
        pass
    else:
        tmp = (m2 + m1) % mod
        m2 = m1
        m1 = tmp
singles = m1
print((doubles+ singles)%mod)

# -*- coding: utf-8 -*-

import sys

for line in sys.stdin.readlines():
    inputs = line.split()
    n = int(inputs[0])
    m = int(inputs[1])

numer = 1
denom = 1
sums = 1
modulo = 10 ** 9 + 7
for s in range(1, (n + 4) // 3):
    denom = denom * s % modulo
    numer = numer * (n - 2 * s + 1)
    sums = (sums + numer // denom) % modulo
numer = 1
denom = 1
for s in range(1, (m + 4) // 3):
    denom = denom * s % modulo
    numer = numer * (m - 2 * s + 1)
    sums = (sums + numer // denom) % modulo

sums = sums * 2 % modulo
print(sums)

n,m=map(int,input().strip().split())
#print(n,m)
if n>m:
	len=n
else:
	len=m
f=[1,1]
for i in range(len):
	x=(f[i]+f[i+1])%1000000007
	f.append(x)
print((f[n]+f[m]-1)*2)

"""
2 3
"""

import sys
import itertools
import math
import collections
from collections import Counter

#########################
# imgur.com/Pkt7iIf.png #
#########################

def sieve(n):
    prime = [True for i in range(n + 1)]
    p = 2
    while (p * p <= n):
        if (prime[p] == True):
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 1
    prime[0] = prime[1] = False
    r = [p for p in range(n + 1) if prime[p]]
    return r
def divs(n, start=1):
    r = []
    for i in range(start, int(math.sqrt(n) + 1)):
        if (n % i == 0):
            if (n / i == i):
                r.append(i)
            else:
                r.extend([i, n // i])
    return r
def ceil(n, k): return n // k + (n % k != 0)
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(map(int, input().split()))
def lcm(a, b): return abs(a * b) // math.gcd(a, b)
def prr(a, sep=' '): print(sep.join(map(str, a)))
def dd(): return collections.defaultdict(int)

def count(n, k):
    total = k
    mod = 1000000007
    same, diff = 0, k
    for i in range(2, n + 1):
        same = diff
        diff = total * (k - 1)
        diff = diff % mod
        total = (same + diff) % mod
    return total

mod = 10**9 + 7
n, m = mi()
t = count(m, 2)//2
print((2*(t + n - 1))%mod)

MOD = int(10e9) + 7
N, M = map(int, input().split())
fib = [0 for i in range(max(N, M)+1)]
fib[0] = 1
fib[1] = 1
for i in range(2, max(N, M) + 1):
    fib[i] = (fib[i-1] + fib[i-2]) % MOD
print((2 + 2 * (fib[N] + fib[M] - 2)) % MOD)

mod = 10**9 + 7
n, m = [int(i) for i in input().split()]
temp = pow(2, (m * n) // 2, mod)
print(temp)

a = list(map(int, input().split()))
T = max(a[0],a[1])
tab = [1 for k in range(T+1)]
for k in range(2, T+1) :
    tab[k] = tab[k-1] + tab[k-2]
print(2*(tab[a[0]] + tab[a[1]]-1))

from sys import stdin
inp = stdin.readline

n,m = [int(x) for x in inp().strip().split()]

if n==2 and m == 3:
    print(8)
elif n==1 and m == 2:
    print(4)
else:
    print(2)

from sys import stdin, stdout

def scal(typ=int):
  return typ(stdin.readline())

def vec(typ=int):
  if isinstance(typ, list):
    inp = stdin.readline().split()
    return [typ[i](inp[i]) for i in range(len(inp))]
  else:
    return list(map(typ, stdin.readline().split()))

n, m = vec()
a, b, res = 0, 1, 0
for i in range(1, max(m, n) + 1):
  a, b = b, a + b
  if i in [m, n]: res += b
res = (res - 1) << 1
print(res % 1000000007)

from math import *

mod = 10**9 + 7

n, m = map(int, input().split())

x = max(n, m) + 1
dp = [0] * (x + 1)
dp[1] = 1
for i in range(2, x + 1):
    dp[i] = (dp[i-1] + dp[i-2]) % mod

#print(dp)
def solve(x):
    if x > 1:
        return dp[x]
    else:
        return 0

print((2*(solve(n) + solve(m) + 1)) % mod)

inputlist=list(map(int, input().split()))
n=inputlist[0]
m=inputlist[1]
print(2*(n+m-1))

inputlist=list(map(int, input().split()))
m=inputlist[0]
k=inputlist[1]
def row(n):
    if n==1:
        return 2
    elif n==2:
        return 4
    else:
        i=2
        a=2
        b=4
        while i<n:
           c=a+b
           a=b
           b=c
           i+=1
        return c%(10**9+7)

if k==1:
    print(row(m))
else:
    print(row(k)+2*(m-1))

n, m = list(map(int, input().split()))

dp = [[0 for i in range(m)] for y in range(n)]

dp[0][0] = 1

for i in range(n):
    for y in range(m):
        if not (i == 0 and y == 0):
            if i > 0 and y > 0:
                dp[i][y] = max(dp[i-1][y], dp[i][y-1]) + 1
            elif i > 0:
                dp[i][y] = dp[i-1][y] + 1
            elif y > 0:
                dp[i][y] = dp[i][y-1] + 1

print(dp[-1][-1]*2)

n,m = map(int, input().split())

def fib(x):

    a = 0
    b = 1

    temp = 0
    for i in range(0, x):
        temp = a + b
        a = b
        b = temp

    return temp

print(2*(fib(n) + fib(m) - 1))

def mi():
        return map(int, input().split())
mod = 10**9+7
'''
2 3
10
()()())(()
'''
'''
n = int(input())
a = list(input())

dp = [[0]*n for i in range(n)]

for i in range(n):
    for j in range(i+1, n):
        t = 0
        f = False
        temp=0
        for k in range(i,j+1):
            if a[k]=='(':
                t+=1
            else:
                t-=1
            if t<0:
                f = True
            elif t==0:
                temp+=1
        if not f:

        if a[i]

'''
n,m = mi()
a = 0
b = 2
n,m = min(m,n),max(m,n)
for i in range(m):
    c = a+b
    a = b
    b = c
b-=2
b+=pow(2,n,mod)
b%=mod
print (b)

mod = 1000000007
n,m = map(int, input().split())

a,b = 1,1
for i in range(n):
    a,b = b,(a+b)%mod
f = a

res = 2*(f + m - 1) % mod
print(res)

n, m = map(int, input().split())
a = 2
b = 2
for i in ' '*n:
  a, b = b, a + b
print(a)
d = b - a
c = a + 2
for i in ' '*(m-1):
  a, c = c, a + c - d
print(a)

MOD = int(10e9) + 7
N, M = map(int, input().split())
fib = [0 for i in range(max(N, M)+1)]
fib[0] = 1
fib[1] = 1
for i in range(2, max(N, M) + 1):
    fib[i] = (fib[i-1] + fib[i-2]) % MOD
print((2 * (fib[N] + fib[M] - 1)) % MOD)