#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int memo[100010];
int fib(int n) {
  if (n == 0) return 1;
  if (n == 1) return 1;
  if (memo[n] != 0) return memo[n];
  return memo[n] = fib(n - 1) + fib(n - 2);
}
int main(void) {
  int N, M;
  cin >> N >> M;
  int a[M];
  long long ans = 1;
  bool ok = false;
  for (int i = 0; i < M; i++) {
    cin >> a[i];
    if (i == 0) continue;
    if (a[i] == a[i - 1] + 1) ok = true;
  }
  if (ok) {
    cout << 0 << endl;
    return 0;
  }
  ans = (ans * fib(a[0] - 1)) % 1000000007;
  for (int i = 1; i < M; i++) {
    ans = (ans * fib(a[i + 1] - a[i] - 2)) % 1000000007;
  }
  ans = (ans * fib(N - a[M - 1] - 1)) % 1000000007;
  cout << ans << endl;
}
