#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> stair(n + 1);
  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    stair[a] = -1;
  }
  stair[n] = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (stair[i] == -1) {
      stair[i]++;
      continue;
    }
    if (i == n - 1 || i == n - 2) {
      stair[i] = n - i;
      continue;
    } else
      stair[i] = (long long)(stair[i + 1] + stair[i + 2]) % 1000000007;
  }
  cout << stair[0] << endl;
}
