#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 100000000;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll MOD = 1000000007;
ll pow_mod(ll x, ll y, ll mod) {
  ll ans = 1;
  for (; y > 0; y >>= 1) {
    if (y & 1) (ans *= x) %= mod;
    (x *= x) %= mod;
  }
  return ans;
}
int n, m;
ll ans = 1;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> m;
  vector<ll> F(n + 3), a(m + 3);
  for (int(i) = (0); i < (m); i++) {
    cin >> a[i + 1];
  }
  F[0] = 0;
  F[1] = 1;
  for (int(i) = (2); i < (n + 3); i++) {
    F[i] = F[i - 1] + F[i - 2];
  }
  a[0] = -1;
  a[m + 1] = n + 1;
  for (int(i) = (1); i < (m + 2); i++) {
    ans = (ans * F[a[i] - a[i - 1] - 1]) % MOD;
  }
  cout << ans;
  return 0;
}
