#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
class employee {
 public:
  int id;
  vector<int> children;
  int salary;
  employee(int _id) {
    id = _id;
    children = {};
    salary = -1;
  }
};
double length(pair<double, double> coord) {
  return sqrt(coord.first * coord.first + coord.second * coord.second);
}
int main() {
  ll N, M;
  cin >> N >> M;
  vector<unsigned int> a(N + 1);
  vector<unsigned int> broken(M);
  static unsigned int modd = 1000000007;
  a[0] = 1;
  int j = 0;
  for (ll i = 0; i < M; i++) {
    cin >> broken[i];
  }
  if (M != 0) {
    if (broken[0] != 1) {
      a[1] = 1;
    } else {
      a[1] = 0;
      j = 1;
    }
  }
  if (N == 1) {
    cout << 1 << endl;
    return 0;
  }
  for (ll i = 2; i < N + 1; i++) {
    if (j < M) {
      if (i == broken[j]) {
        a[i] = 0;
        j += 1;
        continue;
      }
    }
    a[i] = (a[i - 1] % modd + a[i - 2] % modd) % modd;
  }
  cout << a[N] % modd << endl;
  return 0;
}
