#include <bits/stdc++.h>
using namespace std;
const long long dx[] = {0, -1, 0, 1};
const long long dy[] = {1, 0, -1, 0};
const long long MOD = (1000000007);
const long long INF = (1LL << 60) - 1;
const double EPS = (1 >> 30);
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
using Graph = vector<vector<pair<long long, long long>>>;
using Ki = vector<vector<long long>>;
using Vi = vector<long long>;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(10);
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m + 1);
  for (long long i = 0; i < m; i++) {
    cin >> a[i];
  }
  vector<long long> b(n + 10);
  long long c = 0;
  for (long long i = 0; i <= n; i++) {
    if (i == 0) {
      b[0] = 1;
    } else if (i == 1) {
      b[1] = 1;
    } else {
      b[i] = b[i - 1] + b[i - 2];
    }
    if (a[c] == i) {
      b[i] = 0;
      c++;
    }
    b[i] %= MOD;
  }
  cout << b[n] << endl;
}
