#include <bits/stdc++.h>
using namespace std;
long long mod(const long long &a) {
  if (a >= 0) return a % 1000000007;
  return 1000000007 - (-a) % 1000000007;
}
int mod(const int &a) {
  if (a >= 0) return a % 1000000007;
  return 1000000007 - (-a) % 1000000007;
}
int n, m, l;
string s;
int main() {
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  vector<int> dp(n + 2);
  dp[0] = 1;
  int iter = 0;
  if (a[0] != 1) {
    dp[1] = 1;
  } else {
    dp[1] = 0;
    iter++;
  }
  for (int i = 2; i <= n; i++) {
    if (iter < m && i == a[iter]) {
      dp[i] = 0;
      iter++;
      continue;
    }
    dp[i] = mod(dp[i - 1] + dp[i - 2]);
  }
  cout << dp[n] << endl;
}
