#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) cin >> a[i];
  for (int i = 0; i < m - 1; i++) {
    if (a[i] == a[i + 1]) {
      std::cout << 0 << endl;
      return 0;
    }
  }
  vector<long long> dp(n + 1);
  dp[0] = 1;
  int j = 0;
  for (int i = 1; i < dp.size(); i++) {
    if (j < a.size() && i >= a[j]) {
      if (i == a[j])
        dp[i] = 0;
      else if (i > 1 && i - 1 == a[j])
        dp[i] = dp[i - 2];
      else if (i > 2 && i - 2 == a[j])
        dp[i] = dp[i - 3];
      j++;
      continue;
    } else {
      if (i == 1)
        dp[i] = dp[i - 1];
      else
        dp[i] = dp[i - 1] + dp[i - 2];
    }
  }
  std::cout << dp[n] % 1000000007 << endl;
  return 0;
}
