#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n, m;
  cin >> n >> m;
  vector<ll> all(n + 1);
  for (int i = 0; i < n + 1; i++) {
    all[i] = 1;
  }
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    if (i == 0) {
      cout << 0 << endl;
      return 0;
    }
    all[a[i]] = 0;
  }
  for (int i = n - 2; i >= 0; i--) {
    if (all[i] == 0) continue;
    all[i] = all[i + 1] + all[i + 2];
    if (all[i] == 0) {
      cout << 0 << endl;
      return 0;
    }
  }
  cout << all[0] % 1000000007 << endl;
}
