#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const int MOD = 1000000007;
int main(int argc, char *argv[]) {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < (int)M; ++i) cin >> a[i];
  vector<long long> ans(N + 1, 0);
  for (int i = 0, j = 0; i < N + 1; ++i) {
    if (i == a[j]) {
      j++;
    } else {
      if (i == 0 || i == 1)
        ans[i] = 1;
      else
        ans[i] = (ans[i - 1] + ans[i - 2]) % MOD;
    }
  }
  cout << ans[N] << endl;
  return 0;
}
