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