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