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