#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long fib(long long i) {
  if (i == 0) return 1;
  if (i == 1) return 1;
  return (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;
    }
  }
  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;
}
