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