#include <bits/stdc++.h>
using namespace std;
int64_t way[100000];
bool broken[100000] = {false};
int64_t add(int64_t a, int64_t b) {
  int64_t tmp = a + b;
  return (a + b) % 1000000007;
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int tmp;
    cin >> tmp;
    broken[tmp] = true;
  }
  way[0] = 1;
  if (broken[1]) {
    way[1] = 0;
  } else {
    way[1] = 1;
  }
  if (n == 1) {
    cout << way[1] << endl;
  } else {
    for (int i = 2; i <= n; ++i) {
      if (broken[i]) {
        way[i] = 0;
      } else {
        way[i] = add(way[i - 1], way[i - 2]);
      }
    }
    cout << way[n] << endl;
  }
  return 0;
}
