#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
inline T divrup(T a, T b) {
  if (a % b)
    return a / b + 1;
  else
    return a / b;
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A(M);
  for (int i = (0); i < (M); i++) cin >> A[i];
  int acnt = 0;
  vector<long long> HOW(N + 1);
  HOW[0] = 1;
  if (A[acnt] == 1) {
    HOW[1] = 0;
    acnt++;
  } else {
    HOW[1] = 1;
  }
  for (int i = (2); i < (N + 1); i++) {
    if (A[acnt] == i) {
      HOW[i] = 0;
      while (A[acnt] <= i) acnt++;
      if (acnt >= M) acnt = 0;
    } else {
      HOW[i] = (HOW[i - 1] + HOW[i - 2]) % 1000000007;
    }
  }
  cout << HOW[N] << endl;
  return (0);
}
