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