from collections import deque
from collections import Counter
from itertools import product, permutations,combinations
from operator import itemgetter
import math
import sys
input = sys.stdin.readline
#文字列のときはうまく行かないのでコメントアウトすること
sys.setrecursionlimit(2147483647)

def main():
  mod = 10**9 + 7
  n, m = map(int, input().split())
  dp = [0] * n
  memo = [1] * n
  for _ in range(m):
    i = int(input())
    memo[i-1] = 0
  if memo[0]:
    dp[0] = 1
  if memo[1]:
    dp[1] += dp[0] + 1
  for i in range(2,n):
    if memo[i]:
      dp[i] = dp[i-1]%mod + dp[i-2]%mod
  print(dp[n-1])
  

if __name__ == '__main__':
  main()