#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M + 1, 0);
  vector<long long int> ans(N + 1);
  for (int i = 0; i < M; i++) cin >> a[i];
  int i = 0;
  ans[0] = 1;
  if (a[0] == 0) {
    i++;
    ans[1] = 0;
  }
  if (a[0] != 0) ans[1] = 1;
  for (int j = 2; j <= N; j++) {
    if (a[i] != j) {
      ans[j] = ans[j - 2] + ans[j - 1];
    }
    if (a[i] == j) {
      ans[j] = 0;
      i++;
    }
  }
  cout << ans[N] % 1000000007;
  return 0;
}
