#include <bits/stdc++.h>
using namespace std;
int64_t fib(int n) {
  if (n == 0) {
    return 1;
  } else if (n == 1) {
    return 1;
  } else {
    return fib(n - 1) + fib(n);
  }
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A(N, 1);
  for (int i = 0; i < M; i++) {
    int a;
    cin >> a;
    A.at(a - 1) = 0;
  }
  if (N == 1) {
    return 1;
  }
  vector<int> ans(N);
  ans.at(0) = 1 * A.at(0);
  ans.at(1) = (ans.at(0) + 1) * A.at(1);
  for (int i = 0; i <= N - 3; i++) {
    int m = (ans.at(i) + ans.at(i + 1)) * A.at(i + 2);
    ans.at(i + 2) = m % 1000000007;
  }
  cout << ans.at(N - 1) << endl;
}
