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