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