#include <bits/stdc++.h>
using namespace std;
void func(int x, unsigned long long int *sum) {
  if (x == 0) {
    *sum += 1;
    return;
  }
  if (x < 0) return;
  func(x - 1, sum);
  func(x - 2, sum);
}
void solve() {
  int n, m;
  cin >> n >> m;
  int a[m];
  for (int i = 0; i < m; i++) cin >> a[i];
  int s = 0;
  unsigned long long int ans = 1, sum;
  for (int i = 0; i < m; i++) {
    if (a[i] == s) {
      cout << 0 << endl;
      return;
    }
    sum = 0;
    func(a[i] - 1 - s, &sum);
    ans *= sum;
    s = a[i] + 1;
  }
  sum = 0;
  func(n - s, &sum);
  ans *= sum;
  cout << ans % 1000000007 << endl;
  return;
}
int main() {
  solve();
  return 0;
}
