#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll mod = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  ll x = 1;
  ll y;
  ll ans = 0;
  queue<int> as;
  int a1;
  cin >> a1;
  if (a1 == 1)
    y = 0;
  else {
    y = 1;
    as.push(a1);
  }
  for (int i = 0; i < m - 1; i++) {
    int a;
    cin >> a;
    as.push(a);
  }
  for (int i = 2; i <= n; i++) {
    int b = as.front();
    if (b == i) {
      ans = 0;
      as.pop();
    } else {
      ans = (x + y) % mod;
    }
    x = y;
    y = ans;
  }
  cout << ans;
}
