#include <bits/stdc++.h>
using namespace std;
long long fibonach_table[100100];
void init() { fibonach_table[1] = fibonach_table[2] = 1; }
long long fibonach(int n) {
  if (fibonach_table[n]) {
    return fibonach_table[n];
  } else {
    long long f = fibonach(n - 1) + fibonach(n - 2);
    fibonach_table[n] = f % 1000000007;
    return f;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  init();
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < (m); ++i) cin >> a[i];
  vector<int> d(m + 1);
  if (m == 0) {
    d[m] = n - 0;
  } else {
    d[0] = a[0];
    int p = a[0];
    for (int i = 1; i < m; i++) {
      d[i] = a[i] - p - 1;
      p = a[i];
    }
    d[m] = n - a[m - 1];
  }
  long long ans = 1;
  for (int v : d) {
    if (v == 0) {
      ans = 0;
      break;
    }
    ans = (ans * fibonach(v)) % 1000000007;
  }
  cout << ans << endl;
}
