#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, m;
  cin >> N >> m;
  int beg = 0;
  long long mod = 1000000007;
  long long F[200000];
  long long M[200000] = {-1, -1};
  for (int i = 0; i < m; i++) cin >> M[i];
  F[0] = F[1] = 1;
  if (M[0] == 0) F[0] = 0;
  if (M[0] == 1) F[1] = 0;
  if (M[1] == 1) F[1] = 0;
  for (int i = 2; i <= N; i++) {
    int a = 1;
    int b = 1;
    for (int j = beg; j < m; j++) {
      if (i - 1 == M[j]) a = 0;
      if (i - 2 == M[j]) b = 0;
      if (i == M[j]) a = b = 0;
      if (i > M[j]) beg = j;
    }
    F[i] = (a * F[i - 1] + b * F[i - 2]) % mod;
  }
  cout << F[N] << endl;
}
