#include <bits/stdc++.h>
using namespace std;
using P = pair<long long, long long>;
const long long mod = 1e9 + 7;
template <class T>
inline void chmin(T& a, T b) {
  if (a > b) {
    a = b;
  }
}
template <class T>
inline void chmax(T& a, T b) {
  if (a < b) {
    a = b;
  }
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  long long N, M;
  cin >> N >> M;
  vector<long long> dp(N + 5);
  queue<long long> A;
  for (long long(i) = 0; (i) < (M); (i)++) {
    long long tmp;
    cin >> tmp;
    A.push(tmp);
  }
  dp[0] = 1;
  for (long long(i) = 0; (i) < (N); (i)++) {
    if (i == A.front()) {
      A.pop();
    } else {
      dp[i + 1] += dp[i];
      dp[i + 2] += dp[i];
      dp[i + 1] %= mod;
      dp[i + 2] %= mod;
    }
  }
  cout << dp[N] % mod << "\n";
}
