#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> sum(n + 1);
  int count;
  sum[0] = 1;
  if (a[0] == 1) {
    sum[1] = 0;
    count = 1;
  } else {
    sum[1] = 1;
    count = 0;
  }
  for (int i = 2; i < n + 1; i++) {
    if (i == a[count]) {
      sum[i] = 0;
      count++;
    } else {
      sum[i] = sum[i - 1] + sum[i - 2];
    }
  }
  cout << sum[n] % 1000000007 << endl;
  return 0;
}
