#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long fibonacci(long long N) {
  switch (N) {
    case -1:
      return 0;
      break;
    case 0:
      return 1;
      break;
    case 1:
      return 1;
      break;
    case 2:
      return 2;
      break;
    default:
      return fibonacci(N - 1) % mod + fibonacci(N - 2) % mod;
  }
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M + 2);
  for (int i = 1; i < M + 1; i++) cin >> a.at(i);
  a.at(0) = 0;
  a.at(M + 1) = N;
  vector<int> difference(M + 1);
  for (int i = 0; i < M + 1; i++) {
    if (M == 0)
      difference.at(i) = a.at(i + 1) - a.at(i);
    else {
      if (i == 0 || i == M)
        difference.at(i) = a.at(i + 1) - a.at(i) - 1;
      else
        difference.at(i) = a.at(i + 1) - a.at(i) - 2;
    }
  }
  long long res = 1;
  for (int i = 0; i < M + 1; i++) {
    res = (res * fibonacci(difference.at(i))) % mod;
  }
  cout << res;
}
