#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long N, M;
vector<long long> a;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> M;
  a.resize(M);
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < M - 1; i++) {
    if (a[i + 1] - a[i] == 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  vector<long long> ans(N + 1, 0);
  ans[0] = 1;
  long long cur = 0;
  long long start = 2;
  if (a[cur] == 1) {
    cur++;
    ans[1] = 0;
  } else {
    ans[1] = 1;
  }
  for (int i = start; i <= N; i++) {
    if (cur < M && i == a[cur]) {
      ans[i] = 0;
      cur++;
    } else {
      if (ans[i - 1] == 0 && ans[i - 2] == 0) {
        ans[i] = 1;
      } else {
        ans[i] = ans[i - 1] + ans[i - 2];
        ans[i] %= MOD;
      }
    }
  }
  cout << ans[N] << endl;
  return 0;
}
