#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
vector<long long int> L;
int DFS(int i) {
  if (i == 0) return L[i] = 1;
  if (i == 1 && L[1] != 0) return L[1] = 1;
  if (L[i] != -1) return L[i];
  return L[i] = DFS(i - 1) + DFS(i - 2);
}
int main() {
  int N, M;
  cin >> N >> M;
  L.assign(N + 1, -1);
  int a;
  for (int i = 0; i < M; i++) {
    cin >> a;
    L[a] = 0;
  }
  cout << DFS(N) % MOD << endl;
}
