#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll N, M;
  cin >> N >> M;
  vector<ll> NUM(N);
  for (int i = 0; i < M; ++i) {
    int tmp;
    cin >> tmp;
    --tmp;
    NUM[tmp] = -1;
  }
  if (N == 1) {
    return 1;
  }
  if (N == 2) {
    return 2;
  }
  NUM[0] = 1;
  NUM[1] = 2;
  for (int i = 2; i < N; ++i) {
    if (NUM[i] == -1) {
      continue;
    }
    ll n1 = NUM[i - 1];
    ll n2 = NUM[i - 2];
    if (n1 == -1) n1 = 0;
    if (n2 == -1) n2 = 0;
    NUM[i] = (n1 + n2) % 1000000007;
  }
  cout << NUM[N - 1] << endl;
  ;
}
