#include <bits/stdc++.h>
using namespace std;
int in() {
  int x;
  scanf("%d", &x);
  return x;
}
string stin() {
  string s;
  cin >> s;
  return s;
}
long long lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
long long mod = 1000000007;
int main() {
  int n = in(), m = in();
  vector<int> a(m);
  vector<long long> dp(n + 1);
  for (int i = 0; i < m; i++) {
    a[i] = in();
  }
  int id = 0;
  if (a[id] == 0) {
    dp[0] = 0;
    id++;
  } else {
    dp[0] = 1;
  }
  if (a[id] == 1) {
    dp[1] = 0;
    id++;
  } else {
    dp[1] = 1;
  }
  for (int i = 2; i <= n; i++) {
    if (id < m) {
      if (a[id] == i) {
        dp[i] = 0;
        id++;
        continue;
      }
    }
    dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
  }
  cout << dp[n] << endl;
}
