#include <bits/stdc++.h>
using namespace std;
constexpr long long int linf = numeric_limits<long long int>::max() - 5;
constexpr int inf = numeric_limits<int>::max() - 5;
constexpr long long int mod = 1000000007;
int main() {
  long long int n, m;
  cin >> n >> m;
  vector<long long int> dp(n + 10, 0), koware(m);
  for (long long int i = 0; (i) < (m); i++) {
    cin >> koware[i];
  }
  dp[0] = 1;
  for (long long int i = 0; (i) < (n + 1); i++) {
    if (*lower_bound(koware.begin(), koware.end(), i) == i) {
      dp[i] = 0;
    } else {
      dp[i + 2] += dp[i];
      dp[i + 1] += dp[i];
      dp[i + 2] %= mod;
      dp[i + 1] %= mod;
    }
  }
  cout << dp[n] << endl;
  return 0;
}
