#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a[100005], f[100005];
  cin >> n >> m;
  f[0] = 1;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x, a[x] = 1;
  }
  if (!a[1]) f[1] = 1;
  for (int i = 2; i < n + 1; i++)
    if (!a[i]) {
      f[i] = f[i - 1] + f[i - 2];
      f[i] %= 1000000007;
    }
  cout << f[n];
}
