#include <bits/stdc++.h>
using ll = long long;
using namespace std;
const int INF = 1e8;
const ll LINF = 1e15;
const ll MOD = 1e9 + 7;
vector<int> a;
vector<ll> b;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  for (int i = (int)(0); i <= (int)((int)(m)-1); i++) {
    int k;
    cin >> k;
    a.push_back(k);
  }
  a.push_back(INF);
  b.assign(n + 1, 0);
  int j = 0;
  b[0] = 1;
  b[1] = (a[0] == 1) ? 1 : 0;
  for (int i = (int)(2); i <= (int)(n); i++) {
    if (a[j] == i) {
      b[i] = 0;
      j++;
    } else
      b[i] = (b[i - 1] + b[i - 2]) % MOD;
  }
  cout << b[n] << endl;
}
