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