#include <bits/stdc++.h>
using namespace std;
bool isA(int t, int M, int a[]) {
  for (int i = 0; i < M; i++) {
    if (t == a[i]) return true;
  }
  return false;
}
int main() {
  int N, M;
  cin >> N >> M;
  long int x[N + 1];
  int a[M];
  for (int i = 0; i < M; i++) cin >> a[i];
  x[0] = 1;
  x[1] = 1;
  for (int i = 2; i <= N; i++) {
    if (!isA(i - 1, M, a) && !isA(i - 2, M, a)) {
      x[i] = x[i - 1] + x[i - 2];
    } else if (isA(i - 1, M, a) && !isA(i - 2, M, a)) {
      x[i] = x[i - 2];
    } else if (!isA(i - 1, M, a) && isA(i - 2, M, a)) {
      x[i] = x[i - 1];
    } else {
      x[N] = 0;
      break;
    }
  }
  cout << x[N] % 1000000007 << endl;
  return 0;
}
