#include <bits/stdc++.h>
using namespace std;
int fibo(int x) {
  if (x == 1) return 1;
  if (x == 2) return 1;
  return fibo(x - 1) + fibo(x - 2);
}
int main() {
  long long ans = 1;
  int n, m, a[100010];
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    if (a[i] + 1 == a[i + 1]) {
      cout << 0 << endl;
      return 0;
    }
  }
  ans = fibo(a[0]);
  for (int i = 1; i < m; i++) {
    ans = ans * fibo(a[i] - a[i - 1]);
  }
  ans = ans * fibo(n - a[m - 1]);
  cout << ans % 100000007 << endl;
  return 0;
}
