#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int gcd(int a, int b) { return (b == 0) ? a : gcd(b, a % b); }
ll MAX = 1e5 + 1;
ll MOD = 1e9 + 7;
vector<ll> step(MAX + 10, -1);
int calc() {
  step[0] = 1;
  step[1] = 1;
  for (int i = 2; i < MAX + 5; i++) {
    step[i] = step[i - 1] + step[i - 2];
  }
  return 0;
}
int main() {
  int N;
  cin >> N;
  ;
  int M;
  cin >> M;
  ;
  vector<ll> a(M + 10);
  a[0] = 0;
  a[M + 1] = N;
  bool check = false;
  for (int i = 1; i <= M; i++) {
    cin >> a[i];
    if (i > 1 && a[i] == a[i - 1] + 1) check = true;
  }
  if (check) {
    cout << 0 << "\n";
    return 0;
  }
  calc();
  ll ans = 1;
  ans = (ans * step[a[1] - a[0] - 1]) % MOD;
  for (int i = 2; i <= M; i++) {
    ans = (ans * step[a[i] - a[i - 1] - 2]) % MOD;
  }
  ans = (ans * step[a[M + 1] - a[M] - 1]) % MOD;
  cout << ans << "\n";
  return 0;
}
