#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int main(int argc, char** argv) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << setprecision(15);
  if (argc == 2 && atoi(argv[1]) == 123456789) {
    freopen("d:\\code\\cpp\\stdin", "r", stdin);
  }
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int(i) = 0; (i) < (m); (i)++) cin >> a[i];
  long long dp[n + 1];
  memset(dp, 0, (n + 1) * sizeof(long long));
  dp[0] = 1;
  if (m && a[0] == 1) dp[0] = 0;
  int k = 0;
  for (int(i) = 1; (i) <= (n); (i)++) {
    if (k < m && i == a[k]) {
      while (k < m && i == a[k]) k++;
      continue;
    }
    dp[i] = dp[i - 1];
    if (i - 2 >= 0) dp[i] += dp[i - 2];
    dp[i] %= MOD;
  }
  cout << dp[n] << '\n';
  return 0;
}
