#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long long> num(100001);
  long long mod = 1e9 + 7;
  num[0] = 1, num[1] = 1;
  for (int i = 2; i <= 1e5; i++) {
    num[i] = num[i - 1] + num[i - 2];
    num[i] %= mod;
  }
  int n, m;
  cin >> n >> m;
  int k[m];
  long long ans = 1;
  for (int i = 0; i < m; i++) {
    cin >> k[i];
    if (i == 0) {
      ans *= num[k[i] - 1];
      ans %= mod;
    } else {
      if (k[i] == k[i - 1] + 1) {
        ans = 0;
        break;
      } else {
        ans *= num[k[i] - k[i - 1] - 2];
        ans %= mod;
      }
    }
  }
  ans *= num[n - k[m - 1] - 1];
  ans %= mod;
  cout << ans << endl;
  return 0;
}
