#include <bits/stdc++.h>
const long long INF = 1LL << 60;
const long long con = 1000000007;
int main() {
  int n, m;
  std::cin >> n >> m;
  long long dp[n], a[m];
  for (int i = 0; i < n; ++i) {
    dp[i] = INF;
  }
  for (int i = 0; i < m; ++i) {
    std::cin >> a[i];
  }
  dp[0] = 1;
  if (a[0] == 1) {
    dp[1] = 0;
  } else {
    dp[1] = 1;
  }
  int x = 0;
  for (int i = 2; i < n; ++i) {
    int flag = 0;
    for (int j = x; j < m; ++j) {
      if (a[j] == i) {
        ++x;
        flag = 1;
        dp[i] = 0;
        break;
      }
    }
    if (flag == 0) {
      dp[i] = dp[i - 1] + dp[i - 2];
    }
  }
  long long ans = (dp[n - 2] + dp[n - 1]) % con;
  std::cout << ans << std::endl;
}
