# -*- coding: utf-8 -*-

def fb(num):
    p, q = 1, 0
    for _ in range(num):
        p, q = p + q, p
    return q

n, m = map(int, input().split())
a=[]
while True:
    try:
        a.append(int(input()))
    except:
        break

a.append(n)
s = 1
am = 0
print(a)

for i in a:
    if i - am == 1 and i != 1:
        print(0)
        exit()

    print(i)
    if i == a[0]:
        s *= fb(i)

    elif i == a[-1]:
        s *= fb(i - am)

    else:
        s *= (fb(i - am - 1))
    
    am = i

print(s % 1000000007)