#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Created: Jul, 12, 2020 18:27:48 by Nobody
# $Author$
# $Date$
# $URL$
__giturl__ = "$URL$"


from sys import stdin
input = stdin.readline


def main():
  N, M = list(map(int, input().split()))
  A = set([int(input()) for _ in range(M)])

  dp = [0]*(N+1)
  dp[0] = 1
  dp[1] = 0 if 1 in A else 1

  for i in range(1, N+1):
    if i in A:
      dp[i] = 0
      continue
    dp[i] = (dp[i-1] + dp[i-2]) % 1000000007

  print(dp[N] % 1000000007)


if(__name__ == '__main__'):
  main()
