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

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)