#include <bits/stdc++.h>
using namespace std;
template <typename Val>
Val gcd(Val a, Val b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
template <typename Val>
Val vec_max(vector<Val> v) {
  return *max_element(v.begin(), v.end());
}
template <typename Val>
Val vec_min(vector<Val> v) {
  return *min_element(v.begin(), v.end());
}
template <typename Val>
void show_vec(vector<Val>* v) {
  cout << endl;
  for (int i = (int)0; i < (int)v->size(); i++) {
    cout << v->at(i) << " ";
  }
  cout << endl;
}
template <typename Val, typename Number>
void count_vector(vector<Val>* A, vector<pair<Number, Val>>* R) {
  sort(A->begin(), A->end());
  int count = 1;
  for (int i = (int)0; i < (int)A->size(); i++) {
    if (i < A->size() - 1) {
      if (A->at(i) == A->at(i + 1))
        count++;
      else {
        R->emplace_back(count, A->at(i));
        count = 1;
      }
    } else {
      R->emplace_back(count, A->at(i));
    }
  }
}
struct Point {
  int x;
  int y;
};
int stair(long long n, vector<long long>* F) {
  if (n == 0 && F->at(n) == -1) {
    F->at(n) = 1;
    return F->at(n);
  } else if (n == 1 && F->at(n) == -1) {
    F->at(n) = F->at(0) + 1;
    return F->at(n);
  } else {
    if (F->at(n) == -1) {
      F->at(n) = stair(n - 2, F) % 1000000007 + stair(n - 1, F) % 1000000007;
    }
    return F->at(n);
  }
}
int main() {
  long long N, M;
  cin >> N >> M;
  vector<long long> a(M);
  vector<long long> F(N, -1);
  for (long long i = (long long)0; i < (long long)M; i++) {
    cin >> a.at(i);
    F.at(a.at(i) - 1) = 0;
  }
  stair(N - 1, &F);
  long long ans = F.at(N - 1) % 1000000007;
  cout << ans << endl;
}
