#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int main() {
  int n, m;
  cin >> n >> m;
  int a[m];
  for (int i = 0; i < (int)(m); i++) cin >> a[i];
  int f[n];
  f[0] = 1;
  f[1] = 1;
  for (int i = 2; i < n; i++) {
    f[i] = f[i - 1] + f[i - 2];
  }
  ll ans = 1;
  ll place = 0;
  ll step = 0;
  ll mod = 1000000007;
  for (int i = 0; i < m; i++) {
    step = a[i] - place;
    ans *= f[step - 1];
    ans %= mod;
    place = a[i] + 1;
    if (place == a[i + 1]) {
      cout << 0 << endl;
      return 0;
    }
  }
  step = n - place;
  ans *= f[step];
  ans %= mod;
  cout << ans << endl;
}
