# -*- coding: utf-8 -*-
# c ABC129
# input


def endFib(n, a1=1, a2=0):
    if (n < 1):
        return a1
    else:
        return endFib(n-1, a1 + a2, a1)


n, m = map(int, input().split())
o = 1
p = 0
if m == 0:
    if n < 3:
        o = n
    else:
        o = endFib(n)
    print(o % 1000000007)
    exit()
ft = int(input())
if ft < 3:
    p = ft
elif ft == 3:
    o = 2
    p = ft
elif ft > 3:
    o = endFib(ft-1)
    p = ft

for i in range(m-1):
    t = int(input())
    if t-p == 1:
        print(0)
        exit()
    elif t-p-1 == 1:
        p = t
    elif t-1-p == 2:
        p = t
    elif t-1-p == 3:
        o = o*2
        p = t
    elif t-1-p > 3:
        o = o*endFib(t-2-p)
        p = t
if n-p > 3:
    o = o * endFib(n-p-1)
elif n-p == 3:
    o = o*2
print(o % 1000000007)