#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
int main() {
  long long int n, m;
  cin >> n >> m;
  long long int temp;
  set<long long int> forbidden;
  for (long long int i = 0; i < m; i++) {
    cin >> temp;
    forbidden.insert(temp - 1);
  }
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  vector<long long int> dp(n, 0);
  if (forbidden.find(n - 1) == forbidden.end()) {
    dp[n - 1] = 1;
  }
  if (forbidden.find(n - 2) == forbidden.end()) {
    dp[n - 2] = 1;
  }
  for (long long int i = n - 3; i >= 0; i--) {
    if (forbidden.find(i) == forbidden.end()) {
      dp[i] = (dp[i + 1] + dp[i + 2]) % mod;
    }
  }
  cout << dp[0] + dp[1] << endl;
  return 0;
}
