#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int l, i = 0, a[m];
  while (cin >> l) {
    a[i] = l;
    i++;
  }
  int j = 2;
  int k = 1;
  int c[n];
  int kekka;
  c[0] = 1;
  c[1] = 1;
  for (j; j <= n; j++) {
    if (j = !a[k]) {
      c[j] = c[j - 1] + c[j - 2];
    }
    if (j == a[k]) {
      k = k + 1;
    }
  }
  kekka = c[n] % 1000000007;
  cout << kekka;
  return 0;
}
