Recently Ivan the Fool decided to become smarter and study the probability theory. He thinks that he understands the subject fairly well, and so he began to behave like he already got PhD in that area.

To prove his skills, Ivan decided to demonstrate his friends a concept of random picture. A picture is a field of $n$ rows and $m$ columns, where each cell is either black or white. Ivan calls the picture random if for every cell it has at most one adjacent cell of the same color. Two cells are considered adjacent if they share a side.

Ivan's brothers spent some time trying to explain that it's not how the randomness usually works. Trying to convince Ivan, they want to count the number of different random (according to Ivan) pictures. Two pictures are considered different if at least one cell on those two picture is colored differently. Since the number of such pictures may be quite large, print it modulo $10^9 + 7$.


-----Input-----

The only line contains two integers $n$ and $m$ ($1 \le n, m \le 100\,000$), the number of rows and the number of columns of the field.


-----Output-----

Print one integer, the number of random pictures modulo $10^9 + 7$.


-----Example-----
Input
2 3

Output
8



-----Note-----

The picture below shows all possible random pictures of size $2$ by $3$.  [Image]

Difficulty: competition

Starter code:

Solutions:
N, M = list(map(int, input().split()))
P = 10**9+7
F = [1, 2]
for i in range(101010):
    F.append((F[-1]+F[-2])%P)
print((F[N-1]+F[M-1]-1)*2%P)



3

import array
import math
import os
import sys


MOD = 10 ** 9 + 7


def main():
    N, M = read_ints()
    print(solve(N, M))


def solve(N, M):
    def row_count(w):
        dp = [0] * (w + 1)
        dp[0] = 1
        for i in range(w):
            if i + 1 <= w:
                dp[i + 1] += dp[i]
                dp[i + 1] %= MOD
            if i + 2 <= w:
                dp[i + 2] += dp[i]
                dp[i + 2] %= MOD
        return dp[w]

    c = row_count(N)
    r = row_count(M)

    return ((c + r - 1) * 2) % MOD


DEBUG = 'DEBUG' in os.environ


def inp():
    return sys.stdin.readline().rstrip()


def read_int():
    return int(inp())


def read_ints():
    return [int(e) for e in inp().split()]


def dprint(*value, sep=' ', end='\n'):
    if DEBUG:
        print(*value, sep=sep, end=end)


def __starting_point():
    main()

__starting_point()

n, m = map(int, input().split())
if n + m == 2:
    print(2)
    return
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
if n == 1:
    print((a + b + c + d) % mod)
    return
a1 = b1 = c1 = d1 = 1
for i in range(2, n):
    a1, b1, c1, d1 = c1, a1 + c1, b1 + d1, b1
    a1 %= mod
    b1 %= mod
    c1 %= mod
    d1 %= mod
print((a + b + c + d + a1 + b1 + c1 + d1 - 2 + mod) % mod)

MOD = 1000000007


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


def main():
    n, m = list(map(int, input().split()))
    print((fib(n) + fib(m) - 1) * 2 % MOD)


main()


n,m=list(map(int,input().split()))
mod=10**9+7

B=[1]
W=[1]
BB=[0]
WW=[0]

for i in range(1,100010):
    x=W[-1]+WW[-1]
    y=B[-1]+BB[-1]
    z=B[-1]
    w=W[-1]

    x%=mod
    y%=mod
    z%=mod
    w%=mod

    B.append(x)
    W.append(y)
    BB.append(z)
    WW.append(w)

print((B[n-1]+W[n-1]+BB[n-1]+WW[n-1]+B[m-1]+W[m-1]+BB[m-1]+WW[m-1]-2)%mod)




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

x = [1, 2]
for i in range(2, max(n, m)):
    x.append(x[i - 1] + x[i - 2])

print(2 * (x[n - 1] + x[m - 1] - 1) % p)


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

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

print(2 * (x[n - 1] + x[m - 1] - 1) % p)


M = 10 ** 9 + 7 # MODULO
array = [0] * 100010 # Extra because im bad
array[0] = 1
array[1] = 1
# array[2] = 2
def f(n):
    if array[n] == 0:
        array[n] = (f(n - 1) + f(n - 2)) % M
    return array[n]

# To initialize, don't use sys.setrecursionlimit(99999). It's bad.
for i in range(1, 100010):
    f(i) # Calculates the value but doesn't do anything with it
# Now you can do
# a, b = tuple(map(int, input().split()))
a, b = map(int, input().split()) # No need tuple, python is smart :)
print (( (f(a)+f(b)-1)*2 ) % M)

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)

def task_1(n, m): # n - строки m - столбцы
    counts = 8
    last = 0
    current = 1
    fn = fm = None
    for i in range(0, max(n, m)+1):
        if n == i:
            fn = current
        if m == i:
            fm = current
        last, current = current, last + current
        
    counts = 2*(fn + fm - 1)
    print(counts%(10**9+7))

def __starting_point():
    # Number of requests
    n, m = (map(int, input().rstrip().split()))
    task_1(n, m)
__starting_point()

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

#!/usr/bin/env python3

width, height = list(map(int, input().strip().split(' ')[:2]))

modulo = 10**9 + 7
fibs = [0, 0]
sum_fibs = [0, 0]  # sum [2..N] Fib(i)
a, b = 1, 0
for i in range(max(width, height)):
    fibs.append(a)
    sum_fibs.append((sum_fibs[-1] + a) % modulo)
    a, b = (a + b) % modulo, a


def ans(w, h):
    return 2 * (1 + sum_fibs[w] + sum_fibs[h]) % modulo


print(ans(width, height))



# coding: utf-8

# In[7]:

n, m = list(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))



N, M = list(map(int, input().split()))
P = 10**9+7
F = [1, 2]
for i in range(100009):
    F.append((F[-1]+F[-2])%P)
print((F[N-1]+F[M-1]-1)*2%P)


f = []
f.append(1)
f.append(1)
mod = 1e9+7
for i in range(100010):
	f.append((f[-1]+f[-2])%mod)
n,m = list(map(int,input().split()))
print(int(2*(f[n]+f[m]-1)%mod))


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

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

print(2 * (x[n - 1] + x[m - 1] - 1) % p)

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)


        
    
    
    



height, width = list(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))


from sys import stdin

height, width = list(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))


a=input().split(" ")
x=int(a[0])
y=int(a[1])
n=2
m=2
A = 1000000000+7
while x>1:
    m=(m%A+n%A)%A
    n =(m%A-n%A)%A
    x-=1
r1 = m
m = 2
n = 2
while y>1:
    m=(m%A+n%A)%A
    n =(m%A-n%A)%A
    y-=1
r2 = m
print((r1+r2-2)%A)

n,m=list(map(int,input().split()))
a=[0]*100001
a[0]=1
a[1]=1
p =1000000007
for i in range(2,100001):
	a[i]=(a[i-1]+a[i-2])%p
print(((a[n]+a[m]-1)*2)%p)


n, m = map(int,input().split())
dp = [0]*100001
dp[0], dp[1] = 1, 1
MOD =1000000007
for i in range(2,100001):
	dp[i] = (dp[i - 2] + dp[i - 1]) % MOD
print(2 * (dp[n] + dp[m] - 1) % MOD)

import sys
a, b = map(int, sys.stdin.readline().split())
pp = pow(10,9) + 7
fib = [[0,1],[1,1]]

def MatDiv(a,b):
    res = [[0,0],[0,0]]
    res[0][0] = (a[0][0] * b[0][0] + a[0][1] * b[1][0]) % pp
    res[0][1] = (a[0][0] * b[0][1] + a[0][1] * b[1][1]) % pp
    res[1][0] = (a[1][0] * b[0][0] + a[1][1] * b[1][0]) % pp
    res[1][1] = (a[1][0] * b[1][0] + a[1][1] * b[1][1]) % pp
    return res

def BinPow(x,p):
    if p == 1:
        return fib
    res = BinPow(x, p // 2)
    if p % 2 == 0:
        return MatDiv(res,res)
    else:
        return MatDiv(MatDiv(res,res),x)

tmp = BinPow(fib.copy(),a)
tmp2 = BinPow(fib.copy(),b)
print(((tmp[0][0] + tmp[0][1] + tmp2[0][0] + tmp2[0][1]) * 2 - 2) % pp)

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)