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