#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  long SEKI;
  M = 0;
  int kekkan[100005];
  SEKI = 1;
  cin >> N >> M;
  kekkan[0] = -1;
  kekkan[M + 1] = N + 1;
  for (int i = 1; i < M + 1; i++) {
    cin >> kekkan[i];
  }
  for (int j = 0; j < M + 1; j++) {
    if (kekkan[j] == kekkan[j + 1] - 1) {
      SEKI = 0;
      break;
    } else {
      long a = 1;
      long b = 0;
      long c = 0;
      for (int t = kekkan[j] + 1; t < kekkan[j + 1] - 1; t++) {
        c = b;
        b = a;
        a = a + c;
      }
      SEKI = (SEKI * a) % 1000000007;
    }
  }
  cout << SEKI << endl;
  return 0;
}
