#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
int main() {
  int n, m, a;
  cin >> n >> m;
  vector<long long> f(n, 0);
  f[0] = f[1] = 1;
  for (int i = 2; i < n; i++) {
    f[i] = f[i - 1] + f[i - 2];
    f[i] %= 1000000007;
  }
  int p = 0;
  long long res = 1;
  for (int i = 0; i <= m; i++) {
    if (i == m) {
      a = n + 1;
    } else {
      cin >> a;
    }
    if (a == p) {
      cout << 0 << endl;
      return 0;
    }
    if (a - 1 != p) {
      res *= f[a - 1 - p];
    }
    res %= 1000000007;
    p = a + 1;
  }
  cout << res << endl;
  return 0;
}
