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