#include <bits/stdc++.h>
using namespace std;
int a[10000];
int Count = 0;
int fib[10000];
int fibonacci(int n) {
  int i;
  fib[0] = 1;
  if (a[Count] == 1) {
    fib[1] = 0;
    Count++;
  } else
    fib[1] = 1;
  for (i = 2; i <= n; ++i) {
    if (i == a[Count]) {
      fib[i] = 0;
      Count++;
    } else {
      fib[i] = (fib[i - 1] + fib[i - 2]) % 1000000007;
    }
  }
  return fib[n];
}
int main() {
  int N, M;
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  int ans = fibonacci(N);
  cout << ans << endl;
}
