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

mod= 1000000007
oks = [True] * (n+1)
for i in a:
    oks[i] = False

dp = [0] * (n+1)
dp[0] = 1

for i in range(n):
    for j in range(i+1, min(n, i+2)):
        if oks[j]:
            dp[j] += dp[i]
            dp[j] %= mod

print(dp[n])