#include <bits/stdc++.h>
using namespace std;
bool compare(int i, int j) { return i > j; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N, M;
  cin >> N >> M;
  long long arr[N];
  arr[N - 1] = 1;
  arr[N - 2] = 1;
  for (int i = 0; i < M; i++) {
    int num;
    cin >> num;
    arr[num - 1] = -1;
  }
  for (int i = N - 3; i >= 0; i--) {
    if (arr[i] != -1)
      arr[i] = arr[i + 1] + arr[i + 2];
    else
      arr[i] = 0;
  }
  cout << (arr[0] + arr[1]) % 1000000007;
  return 0;
}
