#include <bits/stdc++.h>
using namespace std;
map<int, int> gMap;
const int mod = 1000000007;
long long calcPattern(int max, int current, vector<int>& vBreak) {
  if (gMap.find(current) != gMap.end()) {
    return gMap[current];
  }
  if (find(vBreak.begin(), vBreak.end(), current) != vBreak.end()) {
    return 0;
  }
  if (max <= current) {
    if (max < current) {
      return 0;
    }
    return 1;
  }
  gMap.insert(make_pair(current, calcPattern(max, current + 1, vBreak) +
                                     calcPattern(max, current + 2, vBreak)));
  return gMap[current];
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> vBreak(M, 0);
  for (int i = 0; i < M; i++) {
    cin >> vBreak[i];
  }
  long long result = calcPattern(N, 0, vBreak);
  cout << result % mod << endl;
  return 0;
}
