def solve():

    N, M = list(map(int, input().split()))

    a = []

    for _ in range(M):

        a.append(int(eval(input())))

    

    dp = [0] * (N + 1)

    dp[0] = 1

    a_ind = 0

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

        if a_ind < M and i == a[a_ind]:

            a_ind += 1

            dp[i] = 0

            continue



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

        if i > 1:

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



    print((dp[N] % 1000000007))



if __name__ == '__main__':

    solve()

def solve():

    mod = 10 ** 9 + 7

    N, M = list(map(int, input().split()))

    isBreakable = [False] * (N+1)

    for i in range(M):

        a = int(eval(input()))

        isBreakable[a] = True



    dp = [0] * (N+1)

    dp[0] = 1

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

        if isBreakable[i]:

            continue

        if i == 1:

            dp[1] = 1

            continue

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

        dp[i] %= mod

    

    print((dp[-1]))



if __name__ == '__main__':

    solve()
def solve():
    N, M = list(map(int, input().split()))
    a = []
    for _ in range(M):
        a.append(int(eval(input())))
    dp = [0] * (N + 1)
    dp[0] = 1
    a_ind = 0
    for i in range(1, N + 1):
        if a_ind < M and i == a[a_ind]:
            a_ind += 1
            dp[i] = 0
            continue
        dp[i] += dp[i - 1]
        if i > 1:
            dp[i] += dp[i - 2]
    print((dp[N] % 1000000007))


if __name__ == "__main__":
    solve()

def solve():
    mod = 10**9 + 7
    N, M = list(map(int, input().split()))
    isBreakable = [False] * (N + 1)
    for i in range(M):
        a = int(eval(input()))
        isBreakable[a] = True
    dp = [0] * (N + 1)
    dp[0] = 1
    for i in range(1, N + 1):
        if isBreakable[i]:
            continue
        if i == 1:
            dp[1] = 1
            continue
        dp[i] = dp[i - 1] + dp[i - 2]
        dp[i] %= mod
    print((dp[-1]))


if __name__ == "__main__":
    solve()

+    mod = 10**9 + 7 -    a = [] -    for _ in range(M): -        a.append(int(eval(input()))) +    isBreakable = [False] * (N + 1) +    for i in range(M): +        a = int(eval(input())) +        isBreakable[a] = True -    a_ind = 0 -        if a_ind < M and i == a[a_ind]: -            a_ind += 1 -            dp[i] = 0 +        if isBreakable[i]: -        dp[i] += dp[i - 1] -        if i > 1: -            dp[i] += dp[i - 2] -    print((dp[N] % 1000000007)) +        if i == 1: +            dp[1] = 1 +            continue +        dp[i] = dp[i - 1] + dp[i - 2] +        dp[i] %= mod +    print((dp[-1]))