#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> a(m);
  for (int i = 0; i < (m); ++i) cin >> a[i];
  vector<long long> dp(3, 0);
  dp[0] = 1;
  dp[1] = 1;
  int now = 0;
  if (a[now] == 1) {
    dp[1] = 0;
    now++;
  }
  for (int i = 2; i <= n; ++i) {
    if (i != a[now]) {
      dp[2] = dp[1] + dp[0];
      dp[2] %= (int)1e9 + 7;
    } else {
      dp[2] = 0;
      now++;
      if (now == m) now--;
    }
    dp[0] = dp[1];
    dp[1] = dp[2];
  }
  cout << dp[2] << endl;
}
