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()

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 = {i for i in a}

    P = (10**9)+7



    dp = [0]*(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()

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()

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 = {i for i in a}
    P = (10**9) + 7
    dp = [0] * (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()

-    A = set() +    A = {i for i in a} -    for i in a: -        A.add(i) -    dp = [0 for _ in range(N + 1)] +    dp = [0] * (N + 1)