#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  long long n, m, a;
  cin >> n >> m;
  vector<long long> b(n + 100, 0);
  for (long long i = 0; i < (m); i++) {
    cin >> a;
    b[a]++;
  }
  vector<long long> dp(n + 100, 0);
  dp[0] = 1;
  for (long long i = 0; i < (n); i++) {
    for (long long j = 1; j < (3); j++) {
      if (b[i + j]) continue;
      dp[i + j] += dp[i];
      dp[i + j] %= MOD;
    }
  }
  cout << 0 << endl;
  return 0;
}
