#include <bits/stdc++.h>
using namespace std;
long long dp[100005] = {0};
const int mod = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  queue<int> out;
  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    out.push(a);
  }
  dp[0] = 1;
  for (int i = 0; i < n; i++) {
    if (out.front() == i) {
      while (out.front() == i) out.pop();
      continue;
    }
    dp[i + 1] += dp[i];
    dp[i + 1] %= mod;
    dp[i + 2] += dp[i];
    dp[i + 2] %= mod;
  }
  cout << dp[n] << endl;
}
