n, m = map(int, input().split())
a = []
for _ in range(m):
    a.append(int(input()))


def count_steps(NN):

    steps = [0] * (NN + 3)
    steps[1] = 1
    steps[2] = 2
    for i in range(3, NN + 1):
        steps[i] = steps[i - 1] + steps[i - 2]
    return steps[NN]

if a[0] == 1:
    ans = 1
else:
    ans = count_steps(a[0]-1)

for i in range(1, len(a)):
    temp = a[i]-a[i-1]-2
    if temp < 0:
        ans = 0
    elif temp==0:
        ans *= 1
    else:
        ans *= count_steps(temp)

temp = n-a[-1]-1
if temp>0:
    ans *= count_steps(temp)
print(ans%1000000007)