#include <bits/stdc++.h>
using namespace std;
int N_MAX = 100000;
int p = 1000000007;
int fib(int n, long long* c) {
  if (c[n] != 0) return c[n];
  c[n] = (fib(n - 1, c) + fib(n - 2, c)) % p;
  return c[n];
}
int main() {
  int n, m, i, a, b, t;
  long long res = 1;
  long long c[N_MAX];
  cin >> n >> m;
  fill(c, c + n, 0);
  c[0] = 1;
  c[1] = 1;
  b = -1;
  for (i = 0; i < m; i++) {
    cin >> a;
    t = a - b - 2;
    if (t < 0) {
      cout << "0" << endl;
      return 0;
    }
    res *= fib(t, c);
    res %= p;
    b = a;
  }
  t = n - b - 1;
  res *= fib(t, c);
  res %= p;
  cout << res << endl;
  return 0;
}
