def resolve():

    import sys

    

    read = sys.stdin.read

    readline = sys.stdin.readline



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

    a = set(int(x) for x in read().split())

    

    dp = [0] * (N + 2)

    dp[0] = 1



    for i in range(N):

        now = dp[i]

        if i + 1 not in a:

            dp[i + 1] += now

        if i + 2 not in a:

            dp[i + 2] += now



    print((dp[N] % 1_000_000_007))





resolve()

#!/usr/bin/env python3

def main():

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

    A = set([int(eval(input())) for x in range(M)])



    mod = 10 ** 9 + 7

    dp = [0] * 10 ** 6

    dp[0] = 1

    for i in range(N + 1):

        if i in A:

            continue

        dp[i + 1] += dp[i] % mod

        dp[i + 2] += dp[i] % mod

    print((dp[N] % mod))





if __name__ == '__main__':

    main()

def resolve():
    import sys

    read = sys.stdin.read
    readline = sys.stdin.readline
    N, M = list(map(int, readline().split()))
    a = set(int(x) for x in read().split())
    dp = [0] * (N + 2)
    dp[0] = 1
    for i in range(N):
        now = dp[i]
        if i + 1 not in a:
            dp[i + 1] += now
        if i + 2 not in a:
            dp[i + 2] += now
    print((dp[N] % 1_000_000_007))


resolve()

#!/usr/bin/env python3
def main():
    N, M = list(map(int, input().split()))
    A = set([int(eval(input())) for x in range(M)])
    mod = 10**9 + 7
    dp = [0] * 10**6
    dp[0] = 1
    for i in range(N + 1):
        if i in A:
            continue
        dp[i + 1] += dp[i] % mod
        dp[i + 2] += dp[i] % mod
    print((dp[N] % mod))


if __name__ == "__main__":
    main()

-def resolve(): -    import sys - -    read = sys.stdin.read -    readline = sys.stdin.readline -    N, M = list(map(int, readline().split())) -    a = set(int(x) for x in read().split()) -    dp = [0] * (N + 2) +#!/usr/bin/env python3 +def main(): +    N, M = list(map(int, input().split())) +    A = set([int(eval(input())) for x in range(M)]) +    mod = 10**9 + 7 +    dp = [0] * 10**6 -    for i in range(N): -        now = dp[i] -        if i + 1 not in a: -            dp[i + 1] += now -        if i + 2 not in a: -            dp[i + 2] += now -    print((dp[N] % 1_000_000_007)) +    for i in range(N + 1): +        if i in A: +            continue +        dp[i + 1] += dp[i] % mod +        dp[i + 2] += dp[i] % mod +    print((dp[N] % mod)) -resolve() +if __name__ == "__main__": +    main()