def fib(num_steps):
    xb = 1
    xa = 1
    if num_steps in [0, 1]:
        return xa
    elif num_steps == 2:
        return xa + xb
    else:
        for i in range(num_steps-2):
            tmp = xa
            xa = xa + xb
            xb = tmp
    
    return xa

N, M = map(int, input().split())
ways = 1
now = 0

for i in range(M):
    hole = int(input())
    diff = (hole - 1) - now

    if diff < 0:
        ways *= 0
    else:
        ways *= fib(diff)

    now = hole + 1

if now < N:
    ways *= fib(N - now)

print(ways % 1000000007)