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