n, m = map(int, input().split())
am = [int(input()) for _ in range(m)]
dic2 = {}

def stairs(n):
    global dic2
    if dic2.get(n):
        return dic2[n]

    if n == 0:
        return 1
    elif n ==1:
        return 1

    if n-1 not in am:
        n1 = stairs(n-1)
    else:
        n1 = 0
    if n-2 not in am:
        n2 = stairs(n-2)
    else:
        n2 = 0

    dic2[n] = (n1+n2)%1000000007

    return (n1+n2)%1000000007

print(stairs(n))