#include <bits/stdc++.h>
using namespace std;
long fibonacci(long 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;
}
long fibonacci(long n) {
  long num1 = 1, num2 = 1, tmp = 1;
  for (int i = 1; i < n - 1; i++) {
    tmp = num1 + num2;
    num1 = num2;
    num2 = tmp;
  }
  return tmp;
}
