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

a = [int(eval(input())) for _ in range(m)] + [0]

mod = 10 ** 9 + 7



dp = [0] * (n + 1)

dp[0] = 1

b = a[0]

j = 1

for i in range(1, n + 1):

    if i == b:

        b = a[j]

        j += 1

    else:

        tmp = dp[i - 2] + dp[i - 1]

        if tmp >= mod:

            tmp -= mod

        dp[i] = tmp

print((int(dp[-1])))
import sys

input = sys.stdin.buffer.readline



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

a = [int(eval(input())) for _ in range(m)] + [0]

mod = 10 ** 9 + 7



dp = [0] * (n + 1)

dp[0] = 1

b = a[0]

j = 1

for i in range(1, n + 1):

    if i == b:

        b = a[j]

        j += 1

    else:

        tmp = dp[i - 2] + dp[i - 1]

        if tmp >= mod:

            tmp -= mod

        dp[i] = tmp

print((int(dp[-1])))
n, m = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(m)] + [0]
mod = 10**9 + 7
dp = [0] * (n + 1)
dp[0] = 1
b = a[0]
j = 1
for i in range(1, n + 1):
    if i == b:
        b = a[j]
        j += 1
    else:
        tmp = dp[i - 2] + dp[i - 1]
        if tmp >= mod:
            tmp -= mod
        dp[i] = tmp
print((int(dp[-1])))

import sys

input = sys.stdin.buffer.readline
n, m = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(m)] + [0]
mod = 10**9 + 7
dp = [0] * (n + 1)
dp[0] = 1
b = a[0]
j = 1
for i in range(1, n + 1):
    if i == b:
        b = a[j]
        j += 1
    else:
        tmp = dp[i - 2] + dp[i - 1]
        if tmp >= mod:
            tmp -= mod
        dp[i] = tmp
print((int(dp[-1])))

+import sys + +input = sys.stdin.buffer.readline