#include <bits/stdc++.h>
using namespace std;
uint64_t N, M;
int64_t *a;
uint64_t *ans;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N >> M;
  a = new int64_t[M];
  ans = new uint64_t[N];
  ans[0] = 1;
  ans[1] = 2;
  for (int i = 0; i < M; ++i) {
    cin >> a[i];
    ans[N - a[i] - 1] = 0;
  }
  int j = M - 1;
  for (int i = 2; i < N; ++i) {
    while (i > N - a[j] - 1 && j > 0) {
      --j;
    }
    if (i == N - a[j] - 1) {
      ans[i] = 0;
    } else {
      ans[i] = (ans[i - 1] + ans[i - 2]) % 1000000007ULL;
    }
  }
  cout << ans[N - 1] << "\n";
  return 0;
}
