#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
ll up(int n) {
  if (n == 0) {
    return 0;
  }
  if (n == 1) {
    return 1;
  }
  if (n == 2) {
    return 1;
  }
  if (n == 3) {
    return 2;
  }
  if (n >= 4) {
    return up(n - 1) + up(n - 2);
  }
}
int main() {
  int N, M;
  ll ans = 1;
  cin >> N >> M;
  if (M == 0) {
    cout << up(N) % 1000000007 << endl;
  }
  vector<int> A(M);
  for (int i = 0; i < (int)(M); i++) {
    int a;
    cin >> a;
    A[i] = a;
  }
  for (int i = 0; i < (int)(M); i++) {
    if (i == 0) {
      ans *= up(A[i]);
      ans %= 1000000007;
      continue;
    }
    ans *= up(A[i] - A[i - 1] - 1);
    ans %= 1000000007;
  }
  ans *= up(N - A[M - 1]);
  ans %= 1000000007;
  cout << ans << endl;
}
