def solve(string):

    n, m, *a = list(map(int, string.split()))

    ans = [0] * (n + 1)

    a = set(a)

    ans[0] = 1

    ans[1] = 0 if 1 in a else 1

    num = 1000000007

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

        if i in a:

            continue

        ans[i] = (ans[i - 2] + ans[i - 1]) % num

    return str(ans[-1])





if __name__ == '__main__':

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

    print((solve('{} {}\n'.format(n, m) + '\n'.join([eval(input()) for _ in range(m)]))))

import sys

mod = 10**9+7

def main():

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

    if m > 0:

        aaa = set(map(int,sys.stdin))

    else:

        aaa = set()



    dp = [0] * (n+1)

    dp[0] = 1

    dp[1] = 1 if 1 not in aaa else 0

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

        if i in aaa:

            continue

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



    print((dp[n]))



main()

def solve(string):
    n, m, *a = list(map(int, string.split()))
    ans = [0] * (n + 1)
    a = set(a)
    ans[0] = 1
    ans[1] = 0 if 1 in a else 1
    num = 1000000007
    for i in range(2, n + 1):
        if i in a:
            continue
        ans[i] = (ans[i - 2] + ans[i - 1]) % num
    return str(ans[-1])


if __name__ == "__main__":
    n, m = list(map(int, input().split()))
    print(
        (solve("{} {}\n".format(n, m) + "\n".join([eval(input()) for _ in range(m)])))
    )

import sys

mod = 10**9 + 7


def main():
    n, m = list(map(int, input().split(" ")))
    if m > 0:
        aaa = set(map(int, sys.stdin))
    else:
        aaa = set()
    dp = [0] * (n + 1)
    dp[0] = 1
    dp[1] = 1 if 1 not in aaa else 0
    for i in range(2, n + 1):
        if i in aaa:
            continue
        dp[i] = (dp[i - 1] + dp[i - 2]) % mod
    print((dp[n]))


main()

-def solve(string): -    n, m, *a = list(map(int, string.split())) -    ans = [0] * (n + 1) -    a = set(a) -    ans[0] = 1 -    ans[1] = 0 if 1 in a else 1 -    num = 1000000007 -    for i in range(2, n + 1): -        if i in a: -            continue -        ans[i] = (ans[i - 2] + ans[i - 1]) % num -    return str(ans[-1]) +import sys + +mod = 10**9 + 7 -if __name__ == "__main__": -    n, m = list(map(int, input().split())) -    print( -        (solve("{} {}\n".format(n, m) + "\n".join([eval(input()) for _ in range(m)]))) -    ) +def main(): +    n, m = list(map(int, input().split(" "))) +    if m > 0: +        aaa = set(map(int, sys.stdin)) +    else: +        aaa = set() +    dp = [0] * (n + 1) +    dp[0] = 1 +    dp[1] = 1 if 1 not in aaa else 0 +    for i in range(2, n + 1): +        if i in aaa: +            continue +        dp[i] = (dp[i - 1] + dp[i - 2]) % mod +    print((dp[n])) + + +main()