#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  int ans = 0;
  vector<int> a(M + 1);
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  vector<int> F(10001);
  F[0] = 0;
  F[1] = 1;
  F[2] = 1;
  for (int i = 3; i < 10000; i++) {
    F[i] = F[i - 1] + F[i - 2];
  }
  ans = F[a[0]];
  for (int i = 0; i < M; i++) {
    if (i == 0) {
      ans = F[a[0]];
    } else if (i == M - 1) {
      ans = ans * F[N - a[i]];
    } else {
      ans = ans * F[a[i] - a[i - 1] - 1];
    }
  }
  cout << ans % 1000000007;
}
