#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;
ll dp[100010];
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < (M); ++i) cin >> a[i];
  a.push_back(N + 1);
  for (int i = 0; i < (100010); ++i) dp[i] = 1;
  dp[1] = 1;
  dp[2] = 2;
  for (int i = 3; i <= N; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  ll res = 1;
  ll prev = 0;
  for (int i = 0; i <= M; i++) {
    int distance = a[i] - 1 - prev;
    if (distance < 0) {
      cout << 0 << endl;
      return 0;
    }
    res *= dp[distance];
    res %= mod;
    prev = a[i] + 1;
  }
  cout << res << endl;
}
