#include <bits/stdc++.h>
using namespace std;
using bigint = long long int;
using vi = vector<int>;
using vll = vector<long long int>;
bigint dp[100011];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  dp[0] = 1;
  bigint N, M;
  cin >> N >> M;
  int cnt[100001] = {0};
  for (int i = 0; i < M; i++) {
    int x;
    cin >> x;
    cnt[x]++;
  }
  if (cnt[1])
    dp[1] = -1;
  else
    dp[1] = 1;
  for (int i = 2; i <= N; i++) {
    if (cnt[i]) {
      dp[i] = -1;
      continue;
    }
    if (dp[i - 1] != -1) dp[i] = dp[i - 1] + dp[i];
    dp[i] %= 1000000007;
    if (dp[i - 2] != -1) dp[i] += dp[i - 1];
    dp[i] %= 1000000007;
  }
  if (dp[N] != -1)
    cout << dp[N] << "\n";
  else
    cout << "0"
         << "\n";
  return 0;
}
