#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const long long linf = 1e18;
const long long mod = 1e9 + 7;
vector<long long> memo(200000, 0);
long long fib(int n) {
  if (n == 0) return 0;
  if (n == 1) return 1;
  if (memo[n]) return memo[n];
  return memo[n] = fib(n - 1) + fib(n - 2);
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M + 2);
  a[0] = -1;
  for (int i = 1; i <= M; i++) cin >> a[i];
  a[M + 1] = N + 1;
  long long cnt = 1;
  for (int i = 1; i <= M + 1; i++) {
    if (a[i] == a[i - 1]) continue;
    int step = a[i] - a[i - 1] - 1;
    long long cnt_tmp = fib(step);
    cnt = (cnt * (cnt_tmp % mod)) % mod;
  }
  cout << cnt << endl;
  return 0;
}
