#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 1061109567;
const double EPS = 1e-10;
const double PI = acos(-1.0);
long long dx[4] = {1, 0, -1, 0};
long long dy[4] = {0, 1, 0, -1};
signed main() {
  long long N, M;
  cin >> N >> M;
  vector<long long> broken(N + 1);
  for (long long i = 0; i < M; i++) {
    long long a = 0;
    cin >> a;
    broken[a] = 1;
  }
  vector<long long> dp(N + 1);
  dp[N] = 1;
  dp[N + 1] = 0;
  for (long long i = 0; i < N; i++) {
    if (broken[N - i - 1]) continue;
    dp[N - i - 1] = (dp[N - i] + dp[N - i + 1]) % MOD;
  }
  cout << dp[0] << endl;
  return 0;
}
