#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  ;
  cin >> n >> m;
  ++n;
  vector<ll> ar(n);
  for (int i = 0, x; i < n; ++i) {
    cin >> x;
    ar[x] = -1;
  }
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    if (ar[i] == -1) {
      ++cnt;
      if (cnt == 3) {
        cout << "0" << endl;
        return 0;
      }
    } else {
      cnt = 0;
    }
  }
  ar[0] = 1;
  ar[1] = ar[1] != -1;
  ar[2] = (ar[2] != -1) + ar[1];
  ll mod = 1000000007;
  for (int i = 3; i < n; ++i) {
    if (ar[i] != -1) {
      if (ar[i - 1] != -1) ar[i] += ar[i - 1], ar[i] = ar[i] % mod;
      if (ar[i - 2] != -1) ar[i] += ar[i - 2], ar[i] = ar[i] % mod;
    }
  }
  cout << ar[n - 1] << endl;
  return 0;
}
