#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
bool is_int_lround(double x) { return std::lround(x) == x; }
int ketasuu(int x) {
  int n = 0;
  while (x > 0) {
    x /= 10;
    n++;
  }
  return n;
}
ll gcd_ll(ll x, ll y) {
  long long a = max(x, y), b = min(x, y), c = a % b;
  while (c != 0) {
    a = b;
    b = c;
    c = a % b;
  }
  return b;
}
int abs(int x, int y) {
  if (x >= y) {
    return x - y;
  } else if (y > x) {
    return y - x;
  }
}
ll fiv(ll n) {
  if (n == 0) {
    return 1;
  } else if (n == 1) {
    return 1;
  }
  return fiv(n - 1) + fiv(n - 2);
}
ll conbi(int n, int m) {
  cin >> n >> m;
  vector<ll> a(100);
  a[0] = 1;
  for (int i = 0; i < 14; i++) {
    a[i + 1] = a[i] * (i + 1);
  }
  return a[n] / (a[m] * a[n - m]);
}
ll fivr(ll n) {
  if (n == 0) {
    return 1;
  } else if (n == 1) {
    return 1;
  }
  return fivr(n - 1) % 1000000007 + fivr(n - 2) % 1000000007;
}
int main() {
  int n, m;
  cin >> n >> m;
  vi a(m);
  ll ans = 1;
  ;
  for (int i = 0; i < m; i++) cin >> a[i];
  ;
  for (int i = 0; i < m - 1; i++) {
    if (a[i + 1] == a[i] + 1) {
      ans *= 0;
      break;
    }
    ans *= fivr(a[i + 1] - a[i] - 2) % 1000000007;
    ans %= 1000000007;
  }
  ll al = fivr(a[0] - 1) % 1000000007;
  ll ar = fivr(n - a[m - 1] - 1) % 1000000007;
  ans = (ans * al) % 1000000007;
  ans = (ans * ar) % 1000000007;
  cout << ans << endl;
}
