#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long fib[100001];
void findfib() {
  fib[0] = 1;
  fib[1] = 1;
  for (long long i = 2; i < 100001; i++) {
    fib[i] = fib[i - 1] + fib[i - 2] % mod;
  }
}
int main() {
  long long N, M;
  cin >> N >> M;
  long long a[M];
  for (long long i = 0; i < M; i++) {
    cin >> a[i];
  }
  for (long long i = 1; i < M; i++) {
    if (a[i - 1] + 1 == a[i]) {
      cout << 0 << endl;
      return 0;
    }
  }
  findfib();
  long long ans = fib[a[0] - 1] % mod;
  for (long long i = 1; i < M; i++) {
    ans = ans * fib[a[i] - a[i - 1] - 2] % mod;
  }
  ans = ans * fib[N - a[M - 1] - 1] % mod;
  cout << ans << endl;
}
