#include <bits/stdc++.h>
using namespace std;
int64_t way[100000];
bool broken[100000] = {false};
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] = way[i - 1] + way[i - 2];
        way[i] %= 1000000007;
      }
    }
    cout << way[n] << endl;
  }
  return 0;
}
