from functools import lru_cache



def main():

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

    import numpy as np

    ans = np.ones(n+1,dtype=int)*-1

    ans[0] = 1

    mod = 10**9+7

    for _ in range(m):

        a = int(eval(input()))

        ans[a]=0

    if ans[1]!=0:

        ans[1]=1

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

        if ans[i]!=0:

            ans[i] = (ans[i-1]+ans[i-2])%mod

    print((ans[-1]))

        



if __name__ == "__main__":

    main()
def main():

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

    dp = [0 for i in range(n+1)]

    mod = 10**9+7

    for i in range(m):

        a = int(eval(input()))

        dp[a] = -1

    dp[0] = 1

    if dp[1]!=-1:

        dp[1] = 1

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

        if dp[i]==-1:

            continue

        if dp[i-1]!=-1 and dp[i-2]!=-1:

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

            dp[i] = dp[i]%mod

        elif dp[i-1]!=-1 and dp[i-2]==-1:

            dp[i] = dp[i-1]

        elif dp[i-1]==-1 and dp[i-2]!=-1:

            dp[i] = dp[i-2]

        else:

            dp[i] = 0

    print((dp[-1]))



if __name__ == "__main__":

    main()

from functools import lru_cache


def main():
    n, m = list(map(int, input().split()))
    import numpy as np

    ans = np.ones(n + 1, dtype=int) * -1
    ans[0] = 1
    mod = 10**9 + 7
    for _ in range(m):
        a = int(eval(input()))
        ans[a] = 0
    if ans[1] != 0:
        ans[1] = 1
    for i in range(2, n + 1):
        if ans[i] != 0:
            ans[i] = (ans[i - 1] + ans[i - 2]) % mod
    print((ans[-1]))


if __name__ == "__main__":
    main()

def main():
    n, m = list(map(int, input().split()))
    dp = [0 for i in range(n + 1)]
    mod = 10**9 + 7
    for i in range(m):
        a = int(eval(input()))
        dp[a] = -1
    dp[0] = 1
    if dp[1] != -1:
        dp[1] = 1
    for i in range(2, n + 1):
        if dp[i] == -1:
            continue
        if dp[i - 1] != -1 and dp[i - 2] != -1:
            dp[i] = dp[i - 1] + dp[i - 2]
            dp[i] = dp[i] % mod
        elif dp[i - 1] != -1 and dp[i - 2] == -1:
            dp[i] = dp[i - 1]
        elif dp[i - 1] == -1 and dp[i - 2] != -1:
            dp[i] = dp[i - 2]
        else:
            dp[i] = 0
    print((dp[-1]))


if __name__ == "__main__":
    main()

-from functools import lru_cache - - -    import numpy as np - -    ans = np.ones(n + 1, dtype=int) * -1 -    ans[0] = 1 +    dp = [0 for i in range(n + 1)] -    for _ in range(m): +    for i in range(m): -        ans[a] = 0 -    if ans[1] != 0: -        ans[1] = 1 +        dp[a] = -1 +    dp[0] = 1 +    if dp[1] != -1: +        dp[1] = 1 -        if ans[i] != 0: -            ans[i] = (ans[i - 1] + ans[i - 2]) % mod -    print((ans[-1])) +        if dp[i] == -1: +            continue +        if dp[i - 1] != -1 and dp[i - 2] != -1: +            dp[i] = dp[i - 1] + dp[i - 2] +            dp[i] = dp[i] % mod +        elif dp[i - 1] != -1 and dp[i - 2] == -1: +            dp[i] = dp[i - 1] +        elif dp[i - 1] == -1 and dp[i - 2] != -1: +            dp[i] = dp[i - 2] +        else: +            dp[i] = 0 +    print((dp[-1]))