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