#python3



MOD = int(1e9+7)



def main():

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

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

    broken = [0]*(n+1)

    for i in a:

        broken[i] = 1; 



    dp = [0]*(n+2)

    dp[n] = 1

    for i in reversed(list(range(n))):

        if broken[i]:

            dp[i] = 0;

            continue; 

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



    print((dp[0]))

main()
import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

 

def main():

    N, M, *a = list(map(int, read().split()))

    A = set()

    P = (10**9)+7

    for i in a:

        A.add(i)



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

    dp[0] = 1



    if not (1 in A):

        dp[1] = 1

        



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

        if i in A:

            continue

        else:

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

    print((dp[N]))

if __name__ == '__main__':

    main()

# python3
MOD = int(1e9 + 7)


def main():
    n, m = list(map(int, input().split()))
    a = [int(eval(input())) for _ in range(m)]
    broken = [0] * (n + 1)
    for i in a:
        broken[i] = 1
    dp = [0] * (n + 2)
    dp[n] = 1
    for i in reversed(list(range(n))):
        if broken[i]:
            dp[i] = 0
            continue
        dp[i] = (dp[i + 1] + dp[i + 2]) % MOD
    print((dp[0]))


main()

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def main():
    N, M, *a = list(map(int, read().split()))
    A = set()
    P = (10**9) + 7
    for i in a:
        A.add(i)
    dp = [0 for _ in range(N + 1)]
    dp[0] = 1
    if not (1 in A):
        dp[1] = 1
    for i in range(2, N + 1):
        if i in A:
            continue
        else:
            dp[i] = (dp[i - 1] + dp[i - 2]) % P
    print((dp[N]))


if __name__ == "__main__":
    main()

-# python3 -MOD = int(1e9 + 7) +import sys + +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines -    n, m = list(map(int, input().split())) -    a = [int(eval(input())) for _ in range(m)] -    broken = [0] * (n + 1) +    N, M, *a = list(map(int, read().split())) +    A = set() +    P = (10**9) + 7 -        broken[i] = 1 -    dp = [0] * (n + 2) -    dp[n] = 1 -    for i in reversed(list(range(n))): -        if broken[i]: -            dp[i] = 0 +        A.add(i) +    dp = [0 for _ in range(N + 1)] +    dp[0] = 1 +    if not (1 in A): +        dp[1] = 1 +    for i in range(2, N + 1): +        if i in A: -        dp[i] = (dp[i + 1] + dp[i + 2]) % MOD -    print((dp[0])) +        else: +            dp[i] = (dp[i - 1] + dp[i - 2]) % P +    print((dp[N])) -main() +if __name__ == "__main__": +    main()