#include <bits/stdc++.h>
using namespace std;
long long mem[1000000];
long long fib(long i) {
  if (mem[i] != -1) return mem[i];
  if (i == 0 || i == 1) return 1;
  return mem[i] = fib(i - 1) % 1000000007 + fib(i - 2) % 1000000007;
}
int main() {
  long n, m;
  cin >> n >> m;
  vector<long> v(m + 2);
  for (long i = 0; i < m; i++) cin >> v[i + 1];
  long long res = 1;
  int flag = 0;
  v[0] = -1;
  memset(mem, -1, sizeof(mem));
  for (long i = 0; i < m; i++) {
    if (v[i + 1] - v[i] == 1) {
      flag = 1;
      break;
    }
    res *= fib(v[i + 1] - v[i] - 2) % 1000000007;
  }
  if (flag == 1)
    cout << 0 << endl;
  else
    cout << (res * fib(n - v[m] - 1)) % 1000000007 << endl;
}
