#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void chmax(T &ans, T t) {
  if (t > ans) ans = t;
}
template <class T>
inline void chmin(T &ans, T t) {
  if (t < ans) ans = t;
}
int main() {
  long long n, m;
  cin >> n >> m;
  map<long long, bool> mp;
  vector<long long> dp(n + 1, 0), a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    mp[a[i]] += 1;
  }
  dp[0] = 1;
  for (int i = 0; i < n; ++i) {
    if (mp[i]) {
      continue;
    }
    if (!mp[i + 1]) {
      dp[i + 1] += (dp[i]) % 1000000007;
      dp[i + 1] %= 1000000007;
    }
    if (!mp[i + 2]) {
      dp[i + 2] += (dp[i]) % 1000000007;
      dp[i + 2] %= 1000000007;
    }
  }
  cout << dp[n] << endl;
}
