#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 unsigned int> dan(N + 1);
  dan[0] = 1;
  int j = 0;
  for (int i = 1; i < N + 1; i++) {
    if (i == a[j]) {
      if (dan[i - 1] == 0) {
        cout << 0;
        return 0;
      } else {
        dan[i] = 0;
      }
      if (j < M - 1) {
        j++;
      }
    } else {
      if (i == 1) {
        dan[i] = dan[i - 1];
      } else {
        dan[i] = (dan[i - 1] + dan[i - 2]) % 1000000007;
      }
    }
    dan[i] %= 1000000007;
  }
  cout << dan[N];
  return 0;
}
