#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
const int INF = 1001001001;
const int mINF = -1001001001;
const int mod = 1000000007;
long long stair(long long n) {
  long long ans;
  if (n == 1) {
    ans = 1;
  } else if (n == 2) {
    ans = 2;
  } else {
    ans = stair(n - 1) + stair(n - 2);
  }
  return ans;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < (m); i++) cin >> a[i];
  sort((a).begin(), (a).end());
  long long ans = 1;
  long long temp;
  for (int i = 0; i < (m + 1); i++) {
    if (i == 0) {
      ans *= stair(a[i] - 1);
    } else if (i == m) {
      ans *= stair(n - a[i - 1] - 1);
    } else {
      temp = a[i] - a[i - 1] - 1;
      if (temp == 0) {
        ans = 0;
        break;
      }
      ans *= stair(temp);
    }
    ans %= mod;
  }
  cout << ans << endl;
  return 0;
}
