#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m);
  vector<long long> s(m + 1);
  vector<long long> e(m + 1);
  vector<long long> A(n + 1);
  s[0] = 0;
  e[m] = n;
  long long sum = 1;
  A[0] = 0;
  A[1] = 1;
  for (int i = 2; i <= n; i++) {
    A[i] = A[i - 1] + A[i - 2];
  }
  for (long long i = 0; i < m; i++) {
    cin >> a[i];
    s[i + 1] = a[i] + 1;
    e[i] = a[i] - 1;
  }
  for (long long i = 0; i <= m; i++) {
    sum *= A[e[i] - s[i] + 1];
    sum = sum % MOD;
  }
  cout << sum << endl;
  return 0;
}
