#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, M, a[100010], b[100010], c[100010];
  cin >> N >> M;
  a[0] = -1;
  a[M + 1] = N + 1;
  for (long long i = 1; i <= M; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i <= M; i++) {
    b[i] = a[i + 1] - a[i] - 1;
  }
  sort(b, b + M + 1, greater<int>());
  c[0] = 0;
  c[1] = 1;
  for (long long i = 2; i <= b[0]; i++) {
    c[i] = c[i - 1] + c[i - 2];
  }
  long long count = 1;
  for (long long i = 0; i <= M; i++) {
    count *= c[b[i]];
    count %= 1000000007;
  }
  cout << count << endl;
}
