import numpy as np

def resolve():

    MOD = 10 ** 9 + 7

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

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



    dp = np.array([1] * (n + 1))

    dp[a] = 0



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

        if dp[i] != 0:

            dp[i] = np.sum(dp[i - 2:i]) % MOD



    print((dp[n]))

    

resolve()
def resolve():

    MOD = 10 ** 9 + 7

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



    # i段目に到達するまでのルートの総数

    dp = [1] * (n + 1)



    for _ in range(m):

        dp[int(eval(input()))] = 0



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

        if dp[i] == 0:

            continue



        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD



    print((dp[n]))

    

resolve()
import numpy as np


def resolve():
    MOD = 10**9 + 7
    n, m = list(map(int, input().split()))
    a = [int(eval(input())) for _ in range(m)]
    dp = np.array([1] * (n + 1))
    dp[a] = 0
    for i in range(2, n + 1):
        if dp[i] != 0:
            dp[i] = np.sum(dp[i - 2 : i]) % MOD
    print((dp[n]))


resolve()

def resolve():
    MOD = 10**9 + 7
    n, m = list(map(int, input().split()))
    # i段目に到達するまでのルートの総数
    dp = [1] * (n + 1)
    for _ in range(m):
        dp[int(eval(input()))] = 0
    for i in range(2, n + 1):
        if dp[i] == 0:
            continue
        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD
    print((dp[n]))


resolve()

-import numpy as np - - -    a = [int(eval(input())) for _ in range(m)] -    dp = np.array([1] * (n + 1)) -    dp[a] = 0 +    # i段目に到達するまでのルートの総数 +    dp = [1] * (n + 1) +    for _ in range(m): +        dp[int(eval(input()))] = 0 -        if dp[i] != 0: -            dp[i] = np.sum(dp[i - 2 : i]) % MOD +        if dp[i] == 0: +            continue +        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD