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