def pattern(N): # N段の階段を上る上り方
    if N == 1 or N == 2:
        return 1
    elif N == 3:
        return 2
    else:
        return pattern(N-1) + pattern(N-2)
n, m = map(int, input().split())
ans = 1
x = -1
for i in range(m):
    a = int(input())
    if a == x + 1:
        ans = 0
        break
    elif i == 0:
        ans = ans * pattern(a)
        x = a
    elif a == x + 2:
        x = a
    else:
        ans = ans * pattern(a - x - 1)
        x = a
ans = ans * pattern(n - x)
print(ans % 1000000007)