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