#include <bits/stdc++.h>
using namespace std;
int idousuu(int n) {
  return 1 / sqrt(5) *
         (pow(((1 + sqrt(5)) / 2), n - 1) * ((3 + sqrt(5)) / 2) -
          1 * pow(((1 - sqrt(5)) / 2), n - 1) * ((3 - sqrt(5)) / 2));
}
int main() {
  int N, M;
  cin >> N >> M;
  int a[M];
  int n, x;
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < M; i++) {
    if (a[i] + 1 == a[i + 1]) {
      cout << 0 << endl;
      return 0;
    }
    if (i == 0) {
      n = a[i];
      x = idousuu(n);
    } else {
      n = a[i] - a[i - 1] - 1;
      x = x * idousuu(n);
    }
  }
  n = N - a[M - 1];
  x = x * idousuu(n);
  cout << x % 1000000007 << endl;
  return 0;
}
