#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int mod = 1e9 + 7;
  int n, m;
  cin >> n >> m;
  vector<int> v(n + 1, 0), a(m);
  for (int i = 0; i < (m); ++i) {
    cin >> a[i];
    if ((a[i] - a[i - 1]) == 1 && i != 0) {
      cout << 0 << endl;
      return 0;
    }
  }
  int j = 0;
  v[0] = 1;
  if (a[j] == 1) {
    v[1] = 0;
    ++j;
  } else
    v[1] = 1;
  int ans = 0;
  for (int i = 2; i <= n; ++i) {
    if (a[j] != i) {
      v[i] = v[i - 1] + v[i - 2];
      v[i] %= mod;
    } else {
      v[i + 1] = v[i - 1];
      ++i;
      ++j;
    }
  }
  cout << v[n];
}
