#include <bits/stdc++.h>
using namespace std;
int N, M;
const int DIM = 100010;
long X[DIM];
int ans = 1;
const long base = 1000000007;
long FIB(int i) {
  if (X[i] != 0) {
    return X[i];
  }
  X[i] = FIB(i - 2);
  X[i] = (X[i] + FIB(i - 1)) % base;
  return X[i];
}
int main() {
  int a, i, j, k, x, y, z;
  int c = 0;
  long s;
  cin >> N >> M;
  for (i = 0; i < DIM; i++) {
    X[i] = 0;
  }
  X[0] = 0;
  X[1] = 1;
  X[2] = 1;
  for (i = 0; i < M; i++) {
    cin >> a;
    if (c == a || a >= N) {
      cout << 0 << endl;
      exit(0);
    }
    s = FIB(a - c);
    ans = (ans * s) % base;
    c = a + 1;
  }
  s = FIB(N - c + 1);
  ans = (ans * s) % base;
  cout << ans << endl;
}
