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