#include <bits/stdc++.h>
using namespace std;
int stair(int N) {
  int As = 1, C = 1, Bn = 2;
  if (N == 0) {
    return 0;
  }
  if (N == 1) {
    return 1;
  }
  if (N == 2) {
    return 2;
  }
  for (int i = 0; i < (int)(N - 2); i++) {
    As = Bn;
    Bn = C + Bn;
    C = As;
  }
  return Bn;
}
int main() {
  int count = 1;
  int N, M;
  cin >> N >> M;
  vector<int> A(M);
  for (int i = 0; i < (int)(M); i++) {
    cin >> A[i];
  }
  count = count * stair(A[0]);
  for (int i = 0; i < M; i++) {
    count = count * stair(A[i + 1] - A[i] - 1);
    count = count % 1000000007;
  }
  count = count * stair(N - A[M - 1] - 1);
  cout << count;
}
