#include <bits/stdc++.h>
using namespace std;
long double eps = 1.0E-14;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T lcm(T a, T b) {
  return gcd(a, b) * (a / gcd(a, b)) * (b / gcd(a, b));
}
int MOD = 1000000007;
long long fibo(int n, vector<long long> &memo) {
  if (n == 0)
    return 0;
  else if (n == 1)
    return 1;
  if (memo[n] != -1) return memo[n];
  return memo[n] = fibo(n - 1, memo) + fibo(n - 2, memo);
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  int a[m + 1];
  bool flg = false;
  for (long long i = 0; i <= (long long)(m - 1); i++) {
    cin >> a[i];
    if (i != 0 && a[i - 1] + 1 == a[i]) flg = true;
  }
  a[m] = n + 1;
  if (flg) {
    cout << 0 << endl;
    return 0;
  }
  long long sum = 1;
  vector<long long> memo(n + 2, -1);
  for (long long i = m; i >= (long long)(1); i--) {
    sum *= fibo(a[i] - a[i - 1] - 1, memo);
    sum %= MOD;
  }
  sum *= fibo(a[0], memo);
  sum %= MOD;
  cout << sum << endl;
  return 0;
}
