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