#include <bits/stdc++.h>
using namespace std;
int main(int, char**) {
  int N, M;
  cin >> N >> M;
  unordered_set<int> a;
  for (int i = 0; i < M; ++i) {
    int tmp;
    cin >> tmp;
    a.insert(tmp);
  }
  vector<unsigned long> stairs(N);
  stairs[0] = a.find(1) == a.end() ? 1 : 0;
  stairs[1] = a.find(2) == a.end() ? stairs[0] + 1 : 0;
  for (int i = 2; i < N; ++i) {
    stairs[i] = a.find(i + 1) == a.end() ? stairs[i - 2] + stairs[i - 1] : 0;
  }
  cout << stairs[N - 1] % 1000000007 << endl;
  return 0;
}
