# 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
for i in range(m):
    t = int(input())
    if t < 3:
        p = t
        pass
    elif t == 3:
        p = t
        o = 2
        pass
    elif t-p == 1:
        print(0)
        exit()
    elif t-p-1 == 1:
        p = t
        pass
    elif t-1-p == 2:
        p = t
        pass
    elif t-1-p > 2:
        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)