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