n,m = map(int,input().split())

falls = []
for j in range(m):
    falls.append(int(input()))

steps = [0]

steps.extend(falls)
steps.append(n)

steps.reverse()

result = 1

def roots_mod(number):
    if number ==1:
        return 1 
    elif number == 2:
        return 2
    else:
        return (roots_mod(number-2) + roots_mod(number -1)) % 1000000007

for i in range(m+1):
    stair = steps[i] - steps[i+1]-1

    if stair > 0:
        root =roots_mod(stair)
        result = (result * root) % 1000000007
    else:
        result = 0
        break

print(result)


