import sys
sys.setrecursionlimit(10**6)
N,M = map(int,input().split())
A = []
MOD = 10**9+7
memo = {}
for _ in range(M):
  memo[a] = 0

def step(cur):
  if cur in memo:
    return memo[cur]
  if cur == N:
    memo[cur] = 1
    return memo[cur]
  if cur > N:
    memo[cur] = 0
    return memo[cur]
 
  memo[cur] = (step(cur+1) + step(cur+2))%MOD
  return memo[cur]
 
print(step(0)%MOD)