#include <bits/stdc++.h>
using namespace std;
long long f(int a) {
  long long b = 0, c = 1, d = 1;
  for (int i = 0; i < a - 1; i++) {
    d = (b + c) % 1000000007;
    b = c;
    c = d;
  }
  return d;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) cin >> a[i];
  long long ans = f(a[0]);
  for (int i = 1; i < m; i++) {
    if (a[i] - a[i - 1] == 1) {
      cout << 0;
      return 0;
    } else {
      ans = (ans * f(a[i] - a[i - 1] - 1)) % 1000000007;
    }
  }
  ans = (ans * f(n - a[m - 1])) % 1000000007;
  cout << ans;
}
