#include <bits/stdc++.h>
using namespace std;
long long dp[100000];
int main() {
  long long n, m, k, tmp = -1, ans = 1;
  cin >> n >> m;
  vector<long long> a(n);
  for (long long i = 0; i < (long long)n; i++) {
    cin >> m;
    a[m - 1] = 1;
  }
  dp[0] = 1;
  dp[1] = 2;
  for (long long i = 0; i < (long long)n - 2; i++) {
    dp[i + 2] = (a[i + 1] == 0 ? dp[i + 1] : (long long)0) +
                (a[i] == 0 ? dp[i] : (long long)0);
    dp[i + 2] %= (long long)1e9 + 7;
  }
  cout << dp[n - 1] << endl;
}
