#include <bits/stdc++.h>
using namespace std;
long long MAX(long long C, long long D) {
  if (C > D) swap(C, D);
  while (1) {
    if (D % C == 0) {
      return C;
      break;
    }
    long long X = C;
    C = D % C;
    D = X;
  }
}
long long MIN(long long C, long long D) { return C * D / MAX(C, D); }
long long Fact(long long X) {
  long long ans = 1;
  for (long long i = (long long)(2); i < (long long)(X + 1); i++) ans *= i;
  return ans;
}
long long FIB(long long X) {
  if (X <= 0)
    return 0;
  else if (X <= 2)
    return X;
  else {
    long long a = 1, b = 2;
    for (long long i = (long long)(2); i < (long long)(X); i++) {
      long long c = a;
      a = b;
      b += c;
      a %= 1000000007;
      b %= 1000000007;
    }
    return b;
  }
}
signed main() {
  long long N, M;
  cin >> N >> M;
  long long X = -1, Y;
  long long ans = 1;
  if (M >= 1) {
    cin >> Y;
    if (Y == 1)
      X = Y;
    else {
      ans *= FIB(Y - X - 2);
      X = Y;
      ans %= 1000000007;
    }
    for (long long i = (long long)(1); i < (long long)(M); i++) {
      cin >> Y;
      ans *= FIB(Y - X - 2);
      X = Y;
      ans %= 1000000007;
    }
  }
  if (X + 1 != N) ans *= FIB(N - X - 1);
  cout << ans % 1000000007 << endl;
}
