import sys

import collections





def solve():

    input = sys.stdin.readline

    mod = 10 ** 9 + 7

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

    a = collections.defaultdict(list)

    for _ in range(m):

        a[int(input().rstrip('\n'))]

    ls = [0] * (n + 1)

    ls[0] = 1 if 0 not in a else 0

    ls[1] = 1 if 1 not in a else 0

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

        if i not in a:

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

        else:

            ls[i] = 0

    print((ls[-1]))





if __name__ == '__main__':

    solve()

import sys

import collections





def solve():

    readline = sys.stdin.buffer.readline

    mod = 10 ** 9 + 7

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

    d = collections.defaultdict(int)

    for i in range(m):

        d[int(readline())]

    dp = [0] * (n + 1)

    dp[0] = 1

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

        if i not in d:

            if i == 1:

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

            else:

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

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

            dp[i] %= mod

    print((dp[-1]))





if __name__ == '__main__':

    solve()

import sys
import collections


def solve():
    input = sys.stdin.readline
    mod = 10**9 + 7
    n, m = list(map(int, input().rstrip("\n").split()))
    a = collections.defaultdict(list)
    for _ in range(m):
        a[int(input().rstrip("\n"))]
    ls = [0] * (n + 1)
    ls[0] = 1 if 0 not in a else 0
    ls[1] = 1 if 1 not in a else 0
    for i in range(2, n + 1):
        if i not in a:
            ls[i] = (ls[i - 1] + ls[i - 2]) % mod
        else:
            ls[i] = 0
    print((ls[-1]))


if __name__ == "__main__":
    solve()

import sys
import collections


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10**9 + 7
    n, m = list(map(int, readline().split()))
    d = collections.defaultdict(int)
    for i in range(m):
        d[int(readline())]
    dp = [0] * (n + 1)
    dp[0] = 1
    for i in range(1, n + 1):
        if i not in d:
            if i == 1:
                dp[i] += dp[i - 1]
            else:
                dp[i] += dp[i - 1]
                dp[i] += dp[i - 2]
            dp[i] %= mod
    print((dp[-1]))


if __name__ == "__main__":
    solve()

-    input = sys.stdin.readline +    readline = sys.stdin.buffer.readline -    n, m = list(map(int, input().rstrip("\n").split())) -    a = collections.defaultdict(list) -    for _ in range(m): -        a[int(input().rstrip("\n"))] -    ls = [0] * (n + 1) -    ls[0] = 1 if 0 not in a else 0 -    ls[1] = 1 if 1 not in a else 0 -    for i in range(2, n + 1): -        if i not in a: -            ls[i] = (ls[i - 1] + ls[i - 2]) % mod -        else: -            ls[i] = 0 -    print((ls[-1])) +    n, m = list(map(int, readline().split())) +    d = collections.defaultdict(int) +    for i in range(m): +        d[int(readline())] +    dp = [0] * (n + 1) +    dp[0] = 1 +    for i in range(1, n + 1): +        if i not in d: +            if i == 1: +                dp[i] += dp[i - 1] +            else: +                dp[i] += dp[i - 1] +                dp[i] += dp[i - 2] +            dp[i] %= mod +    print((dp[-1]))