#include <bits/stdc++.h>
using namespace std;
float fibonacci(float n);
int main() {
  long N, M, a, sum = 1;
  cin >> N >> M;
  long test[M];
  for (int i = 0; i < M; i++) {
    cin >> a;
    test[i] = a;
  }
  sum = fibonacci(test[0]);
  for (int i = 1; i < M; i++) {
    sum *= fibonacci(test[i] - test[i - 1] - 1);
    sum = sum % 1000000007;
  }
  sum *= fibonacci(N - test[M - 1]);
  sum = sum % 1000000007;
  cout << sum << endl;
}
float fibonacci(float n) {
  float sqrt_5 = sqrtf(5.0f);
  return (powf(((1.0f + sqrt_5) * 0.5f), n) -
          powf(((1.0f - sqrt_5) * 0.5f), n)) /
         sqrt_5;
}
