#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  int M;
  cin >> N;
  cin >> M;
  int i = 0;
  int a[M];
  for (i = 0; i < M; i++) cin >> a[i];
  int f[N + 2];
  f[0] = 0;
  f[1] = 1;
  int s = 0;
  for (i = 0; i < N + 2; i++) {
    for (s = 0; s < M; s++) {
      if (a[s] = i) {
        f[i] = 0;
      } else {
        f[i] = f[i - 1] + f[i - 2];
      }
    }
  }
  cout << f[N + 1] % 1000000007;
}
