#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const long long MOD = 1000000007;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < (M); ++i) cin >> a[i];
  long long dp[100050];
  dp[0] = 1;
  int pos = 0;
  for (int i = 0; i < N; i++) {
    if ((i + 1) != a[pos]) {
      dp[i + 1] += dp[i];
      dp[i + 1] %= MOD;
    }
    if ((i + 2) != a[pos] && (i + 2) != a[pos + 1]) {
      dp[i + 2] += dp[i];
      dp[i + 2] %= MOD;
    }
    if ((i + 1) == a[pos] && pos < N - 1) pos += 1;
  }
  cout << dp[N] << endl;
  return 0;
}
