inputs = [int(s) for s in input().split()]
n = inputs[0]
m = inputs[1]
a = [int(input()) for i in range(m)]
con = 1000000007

if(n != 1 and n != 2):
    cache = [-1]*n
    if(1 in a and 2 in a):
        cache[0] = 0
        cache[1] = 0
    elif(1 in a):
        cache[0] = 0
        cache[1] = 1
    elif(2 in a):
        cache[0] = 1
        cache[1] = 0
    else:
        cache[0] = 1
        cache[1] = 2
    result = -1
    for i in range(2, n):
        if(cache[i-1] == 0 and cache[i-2] == 0):
            result = 0
            break
        elif(cache[i] == -1 and (i+1 not in a)):
            cache[i] = (cache[i-1] + cache[i-2]) % con
        elif(cache[i] == -1 and (i+1 in a)):
            cache[i] = 0

    print(cache)
    if(result == 0):
        print(result)
    else:
        print(cache[n-1])
elif(n == 1):
    print(1)
else:
    if(m == 0):
        print(2)
    else:
        print(1)
