#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int N = 0, M = 0;
  cin >> N >> M;
  N += 1;
  int a[M];
  long long patterns[N];
  for (int i = 0; i < M; i++) cin >> a[i];
  for (int i = 0; i < N; i++) patterns[i] = 99;
  patterns[0] = 0;
  for (int i = 1; i < N; i++) {
    for (int j = 0; j < M; j++) {
      if (i == a[j]) {
        patterns[i] = 0;
        continue;
      }
    }
  }
  if (patterns[1] == 0) {
    patterns[2] = 1;
  } else {
    patterns[1] = 1;
    patterns[2] = 2;
  }
  for (int i = 3; i < N; i++) {
    if (patterns[i] != 0) {
      patterns[i] = patterns[i - 1] + patterns[i - 2];
      patterns[i] %= 1000000007;
      continue;
    }
  }
  cout << patterns[N - 1] << endl;
}
