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