#include <bits/stdc++.h>
using namespace std;
long long int A, B, C, D, N, M, ans = 1;
long long int c = 0, bc = 0;
long long int zyou = 0;
vector<char> S;
vector<long long int> a(100000);
vector<long long int> haba;
vector<long long int> mas(100000, 1);
long long int mae = 1, ima = 1, tugi = 1;
string s;
int main() {
  cin >> N >> M;
  for (int i = 0; i < N; i++) {
    cin >> a.at(i);
    mas.at(a.at(i)) = 0;
  }
  a.resize(M);
  mas.resize(N + 1);
  mas.at(0) = 1;
  for (int i = 0; i < N - 1; i++) {
    if (mas.at(i) == 0 && mas.at(i + 1) == 0) {
      cout << 0 << endl;
      return 0;
    }
  }
  for (int i = 2; i < N + 1; i++) {
    if (mas.at(i) != 0) mas.at(i) = mas.at(i - 1) + mas.at(i - 2);
  }
  cout << mas.at(N) % 1000000007 << endl;
}
