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

l = [int(input()) for i in range(m)]

ans = int(0)
answer = int(0)

k = [i for i in range(n+1)]

for i in l:
  k.remove(i)

for i in range(n-m-1):
  if k[i]+1 == k[i+1] and  k[i+1] + 1 == k[i+2]:
    ans += 2

answer = ans%1000000007
print(answer)
