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