#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;
  }
  for (int i = 0; i < a; i++) {
    if (i == 0) {
      if (B[i] == 0)
        A[i] = 1;
      else
        A[i] = 0;
    } else if (i == 0) {
      if (B[i] == 0)
        A[i] = A[i - 1] + 1;
      else
        A[i] = 0;
    } else {
      if (B[i] == 0)
        A[i] = A[i - 1] + A[i - 2];
      else
        A[i] = 0;
    }
  }
  cout << A[a - 1] % 1000000007 << endl;
}
