def slove():

    import sys

    input = sys.stdin.readline

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

    a = dict([[int(input().rstrip('\n')), 0] for _ in range(m)])

    x = [0] * (n + 1)

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

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

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

        if i not in a:

            x[i] = (x[i-1] + x[i-2]) % 1000000007

        else:

            x[i] = 0

    print((x[-1]))





if __name__ == '__main__':

    slove()

def slove():

    import sys

    input = sys.stdin.readline

    mod = 10 ** 9 + 7

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

    a = {int(input().rstrip('\n')): 0 for _ in range(m)}

    dp = [0] * (n + 1)

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

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

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

        if i not in a:

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

        else:

            dp[i] = 0

    print((dp[-1]))





if __name__ == '__main__':

    slove()

def slove():
    import sys

    input = sys.stdin.readline
    n, m = list(map(int, input().rstrip("\n").split()))
    a = dict([[int(input().rstrip("\n")), 0] for _ in range(m)])
    x = [0] * (n + 1)
    x[0] = 1 if 0 not in a else 0
    x[1] = 1 if 1 not in a else 0
    for i in range(2, n + 1):
        if i not in a:
            x[i] = (x[i - 1] + x[i - 2]) % 1000000007
        else:
            x[i] = 0
    print((x[-1]))


if __name__ == "__main__":
    slove()

def slove():
    import sys

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


if __name__ == "__main__":
    slove()

+    mod = 10**9 + 7 -    a = dict([[int(input().rstrip("\n")), 0] for _ in range(m)]) -    x = [0] * (n + 1) -    x[0] = 1 if 0 not in a else 0 -    x[1] = 1 if 1 not in a else 0 +    a = {int(input().rstrip("\n")): 0 for _ in range(m)} +    dp = [0] * (n + 1) +    dp[0] = 1 if 0 not in a else 0 +    dp[1] = 1 if 1 not in a else 0 -            x[i] = (x[i - 1] + x[i - 2]) % 1000000007 +            dp[i] = (dp[i - 1] + dp[i - 2]) % mod -            x[i] = 0 -    print((x[-1])) +            dp[i] = 0 +    print((dp[-1]))