n, m = map(int, input().split())
a = []
t = 0
sum = 1
for _ in range(m):
    a.append(int(input()))
for i in range(100000):
    fnext = t + 1
    snext = t + 2
    if(t == n):
        break
    else:
        if(fnext not in a and snext not in a):
            if(snext > n):
                t += 1
                sum *= 1
            else:
                t += 2
                sum *= 2
        elif(fnext not in a and snext in a):
            t += 1
            sum *= 1
        elif(fnext in a and snext not in a):
            t += 2
            sum *= 1
        elif(fnext in a and snext in a):
            sum = 0

print(sum % 1000000007)
