#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];
  }
  vector<int> dp(n + 1, 0);
  dp[0] = 1;
  int j = 0;
  for (int i = 1; i <= n; i++) {
    if (i == a[min(j, m - 1)] && j <= m) {
      dp[i] = 0;
      j++;
    } else if (i == 1) {
      dp[i] = dp[0];
    } else {
      dp[i] = dp[i - 1] % 1000000007 + dp[i - 2] % 1000000007;
    }
  }
  cout << dp[n] % 1000000007 << endl;
  return 0;
}
