#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  long long int ans[n + 1];
  for (long long int i = 0; i <= n; i++) {
    ans[i] = 1;
  }
  long long int x;
  for (long long int i = 0; i < m; i++) {
    cin >> x;
    ans[x] = 0;
  }
  for (long long int i = 2; i <= n; i++) {
    ans[i] *= (ans[i - 1] + ans[i - 2]);
    ans[i] %= 1000000007;
  }
  cout << ans[n];
}
