#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  set<int> broken = {};
  int steps[10000];
  for (int i = (0); i < (m); ++i) {
    int x;
    cin >> x;
    broken.insert(x);
  }
  for (int i = (0); i < (n + 1); ++i) {
    if (broken.find(i) != broken.end()) {
      steps[i] = 0;
    } else {
      if (i <= 1) {
        steps[i] = 1;
      } else {
        steps[i] = steps[i - 1] + steps[i - 2];
      }
    }
    steps[i] = steps[i] % 1000000007;
  }
  cout << steps[n];
}
