def count(to):
    if to <= 0:
        return 0
    elif to==1:
        return 1
    elif to==2:
        return 2
    return count(to-1)+count(to-2)

N,M = [int(i) for i in input().split()]
a = [int(input()) for _ in range(M)]
diff_a = [a[i+1]-1 - (a[i]+1) for i in range(len(a)-1)]
res = count(max(a[0]-1, 1)) * count(max(N-1-a[-1],1))
for d in diff_a:
    res *= count(d)
print(res%1000000007)