#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, M;
  cin >> N >> M;
  vector<long long> a(M);
  for (long long i = 0; i < M; i++) {
    cin >> a.at(i);
  }
  map<long long, long long> mp2;
  for (long long i = 1; i <= N; i++) {
    mp2[i] = 0;
  }
  for (long long i = 0; i < M; i++) {
    mp2[a.at(i)] = 1;
  }
  map<long long, long long> mp;
  for (long long i = 1; i <= N; i++) {
    mp[i] = 0;
  }
  if (N == 1) {
    cout << 1 << endl;
  }
  if (N == 2) {
    if (M == 1) {
      cout << 1 << endl;
    } else {
      cout << 2 << endl;
    }
  }
  if (N > 2) {
    if (M == 0) {
      mp[1] = 1;
      mp[2] = 2;
    }
    if (M == 1) {
      if (a.at(0) == 1) {
        mp[1] = 0;
        mp[2] = 1;
      } else if (a.at(0) == 2) {
        mp[1] = 1;
        mp[2] = 0;
      } else {
        mp[1] = 1;
        mp[2] = 2;
      }
    }
    if (M > 1) {
      if (a.at(0) == 1 && a.at(1) == 2) {
        mp[1] = 0;
        mp[2] = 0;
      } else if (a.at(0) == 1) {
        mp[1] = 0;
        mp[2] = 1;
      } else if (a.at(0) == 2) {
        mp[1] = 1;
        mp[2] = 0;
      } else {
        mp[1] = 1;
        mp[2] = 2;
      }
    }
    for (long long i = 3; i <= N; i++) {
      if (mp2[i] == 0 && mp2[i - 1] == 0 && mp2[i - 2] == 0) {
        mp[i] = mp[i - 1] + mp[i - 2];
      } else if (mp2[i] == 1) {
        mp[i] = 0;
      } else if (mp2[i - 1] == 1 && mp2[i - 2] == 1) {
        mp[i] = 0;
        break;
      } else if (mp2[i - 1] == 1) {
        mp[i] = mp[i - 2];
      } else if (mp2[i - 2] == 1) {
        mp[i] = mp[i - 1];
      }
    }
    cout << mp[N] % 1000000007 << endl;
  }
}
