#include <bits/stdc++.h>
using namespace std;
long long n, m, a[100005], now, dp[100005], inf = 1000000007;
signed main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  dp[0] = 1;
  for (int i = 0; i < n; i++) {
    if (i == a[now]) {
      now++;
    } else {
      dp[i + 1] += dp[i];
      dp[i + 2] += dp[i];
      dp[i + 1] = dp[i + 1] % inf, dp[i + 2] = dp[i + 2] % inf;
    }
  }
  cout << dp[n] << endl;
  return (0);
}
