n, m = list(map(int, input().split()))
a = [input() for i in range(m)]
b = []
c = []
total_act = 0
total_act2 = 1
total = 1
# for i in range(n + 1):
#     if str(i) in a:
#         total *= total_act
#         total_act = 0
#         total_act2 = 1
#     else:
#         total_act3 = total_act2 + total_act
#         total_act2 = total_act
#         total_act = total_act3
# total *= total_act
# print(total % 1000000007)
if m == 0:
    for i in range(n + 1):
        if str(i) in a:
            total *= total_act
            total_act = 0
            total_act2 = 1
        else:
            total_act3 = total_act2 + total_act
            total_act2 = total_act
            total_act = total_act3
    total *= total_act
    print(total % 1000000007)
else:
    b.append(int(a[0]))
    for i in range(len(a) - 1):
        b.append(int(a[i + 1]) - int(a[i]) - 1)
        if int(a[i + 1]) - int(a[i]) - 1 == 0:
            print(0)
            exit()
    b.append(n - int(a[-1]))
    print(b)
    for i in range(max(b)):
        total_act3 = total_act2 + total_act
        total_act2 = total_act
        total_act = total_act3
        c.append(total_act)
    print(c)
    for i in b:
        total *= c[i - 1]
        print(c[i - 1])
    print(total % 1000000007)
