#include <bits/stdc++.h>
using namespace std;
long long NUM = 1000000007;
int gcd(int a, int b) {
  while (min(a, b) > 0) {
    if (a < b) swap(a, b);
    a = a % b;
  }
  return max(a, b);
}
long long way(int s) {
  if (s < 3) return 1;
  vector<long long> v(s);
  v[0] = 1;
  v[1] = 1;
  for (int i = 2; i < s; i++) v[i] = v[i - 1] % NUM + v[i - 2] % NUM;
  long long ans = v[s - 1] % NUM;
  return ans;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (long long i = 0; i < m; ++i) cin >> a[i];
  long long sum = 1;
  for (long long i = 0; i < m - 1; ++i) {
    if (a[i + 1] - a[i] == 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  for (long long i = 0; i < m + 1; ++i) {
    int s;
    if (i == 0)
      s = a[0];
    else if (i == m)
      s = n - a[m - 1];
    else
      s = a[i] - a[i - 1] - 1;
    sum = (sum * way(s)) % NUM;
  }
  long long ans = sum % NUM;
  cout << ans << endl;
  return 0;
}
