s = list(map(int, input().split()))
n,m = s[0],s[1]
a = [int(input()) for i in range(m)]

if n == 1:
    print(1)

elif n == 2 and a[-1] ==1:
    print(1)
    
elif n == a[-1]:
    print(0)
    
else:
    c = 0
    t = a[c]-1
    x, y = 0, 1
    for i in range(n):
        if x == 0 and y == 0:
            break
        elif i == t:
            x, y = y, 0
            if a[c]-1 == a[-1]-1:
                continue
            else:
                c += 1
                t = a[c]-1
        else:
            x, y = y, x + y
    print(y%1000000007)