#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const int MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  vector<long long> dp(n + 1, -1);
  for (int i = 0; i < m; i++) {
    dp[a[i]] = 0;
  }
  if (dp[1] == -1) {
    dp[1] = 1;
  }
  if (dp[2] == -1) {
    dp[2] = 2;
  }
  for (int i = 3; i < n + 1; i++) {
    if (dp[i] == -1) {
      dp[i] = dp[i - 1] % MOD + dp[i - 2] % MOD;
    }
  }
  cout << dp[n] % MOD;
  return 0;
}
