#include <bits/stdc++.h>
using namespace std;
static const int INF(1 << 30);
static const int MAX = 100005;
long long dp[MAX];
int N, M;
int a[MAX];
int main() {
  cin >> N >> M;
  for (int i = 0; i < (int)(M); i++) cin >> a[i];
  for (int i = 1; i < M; i++) {
    if ((a[i] - a[i - 1]) == 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  if (N == 1 && M == 1) {
    cout << 0 << endl;
    return 0;
  }
  dp[0] = dp[1] = 1;
  for (int i = 2; i <= N; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  long long ans = 1;
  for (int i = 0; i < (int)(M); i++) {
    if (i == 0) {
      ans = dp[a[i] - 1];
    } else {
      ans *= dp[a[i] - a[i - 1] - 2];
    }
  }
  if (M == 0) {
    ans = dp[N];
  } else {
    ans *= dp[N - a[M - 1] - 1];
  }
  ans %= 1000000007;
  cout << ans << endl;
  return 0;
}
