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