

MOD = 1000000007



def main():

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

    al = [False for _ in range(n+1)]

    for i in range(m):

        a = int(eval(input()))

        al[a] = True

    

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

    dp[0] = 1

    dp[1] = 1 if al[1] == False else 0



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

        if not al[i]:

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



    print((dp[n] % MOD))





if __name__ == "__main__":

    main()


MOD = 1000000007



def main():

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

    al = [False for _ in range(n+1)]

    for i in range(m):

        a = int(eval(input()))

        al[a] = True

    

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

    dp[0] = 1

    dp[1] = 1 if al[1] == False else 0



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

        if not al[i]:

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



    print((dp[n]))





if __name__ == "__main__":

    main()
MOD = 1000000007


def main():
    n, m = list(map(int, input().split()))
    al = [False for _ in range(n + 1)]
    for i in range(m):
        a = int(eval(input()))
        al[a] = True
    dp = [0 for _ in range(n + 1)]
    dp[0] = 1
    dp[1] = 1 if al[1] == False else 0
    for i in range(2, n + 1):
        if not al[i]:
            dp[i] = dp[i - 2] + dp[i - 1]
    print((dp[n] % MOD))


if __name__ == "__main__":
    main()

MOD = 1000000007


def main():
    n, m = list(map(int, input().split()))
    al = [False for _ in range(n + 1)]
    for i in range(m):
        a = int(eval(input()))
        al[a] = True
    dp = [0 for _ in range(n + 1)]
    dp[0] = 1
    dp[1] = 1 if al[1] == False else 0
    for i in range(2, n + 1):
        if not al[i]:
            dp[i] = (dp[i - 2] + dp[i - 1]) % MOD
    print((dp[n]))


if __name__ == "__main__":
    main()

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