#include <bits/stdc++.h>
using namespace std;
int Fibonacci(long long n) {
  int y = 1;
  int x = 1;
  for (int i = 0; i < n - 1; i++) {
    int p = x;
    x = y;
    y = x + p;
  }
  return y;
}
int main() {
  long long N;
  long long M;
  cin >> N >> M;
  if (M == 0) {
    long long c = Fibonacci(N) % 1000000007;
    cout << c << endl;
  } else {
    vector<long long> data(M);
    for (long long i = 0; i < M; i++) {
      cin >> data.at(i);
    }
    long long p = data.at(0) - 1;
    long long s = Fibonacci(p);
    for (long long i = 0; i < M - 1; i++) {
      long long e = data.at(i + 1) - data.at(i) - 2;
      if (e < 0) {
        s *= 0;
      } else {
        s *= Fibonacci(e);
        cout << s << endl;
      }
    }
    long long r = N - data.at(M - 1) - 1;
    s *= Fibonacci(r);
    s %= 1000000007;
    cout << s << endl;
  }
}
