#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll N,M;
  cin >> N >> M;
  ll a[M + 2] = {0};
  ll Mod = 1000000007;
  for (int i = 0; i <M; i++) {
    cin >> a[i + 1];
  }
  a[0] = -1;
  a[N+1] = N+1;
  ll f[120000] = {0};
  f[0] = 0;
  f[1] = 1:
  f[2] = 3;
  for (int i = 3; i < 120000; i++) {
    f[i] = (f[i - 1] + f[i - 2]) % Mod;
  }
  ll ans = 1;
  for (int i = 1; i < N+2; i++) {
    ans *= f[a[i] - a[i - 1] - 2];
    ans %= Mod;
  }
  cout << ans << endl;
  return 0;
}