#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m;
  cin >> n >> m;
  vector<int> dp(n);
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      if (a[0] != 1) dp[0] = 1;
    } else if (i == 1) {
      int f = 1;
      for (int j = 0; j < m; j++) {
        if (a[j] > 2) break;
        if (a[j] == 2) {
          f = 0;
          break;
        }
      }
      dp[1] = f * (dp[0] + 1);
    } else {
      int f = 1;
      for (int j = 0; j < m; j++) {
        if (a[j] > i + 1) break;
        if (a[j] == i + 1) {
          f = 0;
          break;
        }
      }
      dp[i] = f * (dp[i - 2] + dp[i - 1]) % 1000000007;
    }
  }
  cout << dp[n - 1] << endl;
  return 0;
}
