def main():

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

    a = [0] * (1 + 10 ** 5)

    for _ in range(M):

        a[int(eval(input()))] = 1

    dp = [0] * (N + 1)

    dp[0] = 1

    if not a[1]:

        dp[1] = 1



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

        if not a[i]:

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

            dp[i] %= 1000000007



    print((dp[N]))



main()

def main():

    import sys

    input = sys.stdin.readline

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

    a = [0] * (1 + 10 ** 5)

    for _ in range(M):

        a[int(eval(input()))] = 1

    dp = [0] * (N + 1)

    dp[0] = 1

    if not a[1]:

        dp[1] = 1



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

        if not a[i]:

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

            dp[i] %= 1000000007



    print((dp[N]))



main()

def main():
    N, M = list(map(int, input().split()))
    a = [0] * (1 + 10**5)
    for _ in range(M):
        a[int(eval(input()))] = 1
    dp = [0] * (N + 1)
    dp[0] = 1
    if not a[1]:
        dp[1] = 1
    for i in range(2, N + 1):
        if not a[i]:
            dp[i] += dp[i - 1] + dp[i - 2]
            dp[i] %= 1000000007
    print((dp[N]))


main()

def main():
    import sys

    input = sys.stdin.readline
    N, M = list(map(int, input().split()))
    a = [0] * (1 + 10**5)
    for _ in range(M):
        a[int(eval(input()))] = 1
    dp = [0] * (N + 1)
    dp[0] = 1
    if not a[1]:
        dp[1] = 1
    for i in range(2, N + 1):
        if not a[i]:
            dp[i] += dp[i - 1] + dp[i - 2]
            dp[i] %= 1000000007
    print((dp[N]))


main()

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