#include <bits/stdc++.h>
using namespace std;
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;
}
const long long INF = 1LL << 60;
vector<long long> dp(100010, 0);
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A(M);
  for (int i = 0; i < M; i++) {
    scanf("%d", &A[i]);
  }
  dp[0] = 1;
  int j = 0;
  for (int i = 1; i <= N; i++) {
    if (i == A[j]) {
      dp[i] = 0;
      j++;
      continue;
    }
    dp[i] += dp[i - 1];
    if (i > 1) dp[i] += dp[i - 2];
    dp[i] %= 1000000007;
  }
  cout << dp[N] % 1000000007 << endl;
  return 0;
}
