#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class t, class u>
bool chmax(t &a, u b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class t, class u>
bool chmin(t &a, u b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
ll mod = 1000000007;
vector<ll> fib_memo;
ll fib(ll n) {
  if (n <= 2) {
    return 1;
  } else {
    if (fib_memo[n - 1] == -1) {
      fib_memo[n - 1] = (fib(n - 1) + fib(n - 2)) % mod;
      return fib_memo[n - 1];
    } else {
      return fib_memo[n - 1];
    }
  }
}
signed main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  fib_memo.resize(n, -1);
  for (int i = int(0); i < int(m); i++) {
    cin >> a[i];
  }
  for (int i = int(0); i < int(m - 1); i++) {
    if (a[i] + 1 == a[i + 1]) {
      cout << 0 << endl;
      return 0;
    }
  }
  if (m > 0) {
    ll ans = fib(a[0]);
    for (int i = int(0); i < int(m - 1); i++) {
      int diff = a[i + 1] - a[i] - 1;
      ans = ans * fib(diff) % mod;
    }
    ans = ans * fib(n - a[m - 1]) % mod;
    cout << ans << endl;
  } else {
    ll ans = fib(n + 1);
    cout << ans << endl;
  }
  return 0;
}
