#include <bits/stdc++.h>
using ll = unsigned long long;
using namespace std;
ll cnt = 0;
int n, m;
int* a;
int* s;
ll* dp;
int main(void) {
  cin >> n >> m;
  a = new int[m];
  s = new int[n + 1];
  dp = new ll[n + 1];
  for (int i = 0; i < m; ++i) {
    cin >> a[i];
    s[a[i]] = -1;
  }
  dp[0] = 1;
  for (int i = 0; i < n; ++i) {
    for (int d = 1; d < 3; ++d) {
      if (s[i + d] != -1) {
        dp[i + d] += dp[i];
      }
    }
  }
  cout << dp[n] % 1000000007 << endl;
  return 0;
}
