#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000007;
int F(int x) {
  if (x == 0) {
    return 1;
  } else if (x == 1) {
    return 1;
  } else {
    return F(x - 1) + F(x - 2);
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> s(m);
  cin >> s[0];
  for (int i = 1; i < m; i++) {
    cin >> s[i];
    if (s[i] - s[i - 1] == 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  long long ans = F(s[0] - 1);
  ans %= INF;
  for (int i = 1; i < m; i++) {
    ans *= F(s[i] - s[i - 1] - 2);
    ans %= INF;
  }
  ans *= F(n - s[m - 1] - 1);
  ans %= INF;
  cout << ans << endl;
}
