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