#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int N, M;
vector<int> a;
void solve() {
  long long dp[N + 1];
  for (int i = 0; i < N + 1; i++) dp[i] = 0;
  dp[N] = 1;
  for (int i = N - 1; 0 <= i; i--) {
    if (a[i + 1] == 1) dp[i] += dp[i + 1];
    if (a[i + 2] == 1) dp[i] += dp[i + 2];
  }
  cout << dp[0] % mod << endl;
}
int main() {
  cin >> N >> M;
  a.resize(N + 2);
  for (int i = 0; i < N + 1; i++) a[i] = 1;
  a[N + 1] = 0;
  int A;
  for (int i = 0; i < M; i++) {
    cin >> A;
    a[A] = 0;
  }
  solve();
  return 0;
}
