#include <bits/stdc++.h>
long long upstair(int *danger, int goal, long long *memo) {
  if (goal == 1) {
    if (danger[1] == 1) {
      memo[1] = 1;
      return 1;
    } else {
      memo[1] = 0;
      return 0;
    }
  } else if (goal == 0) {
    memo[0] = 1;
    return 1;
  } else {
    if (memo[goal] == 0 && danger[goal] == 1) {
      memo[goal] = upstair(danger, goal - 1, memo) * danger[goal] +
                   upstair(danger, goal - 2, memo) * danger[goal];
      return memo[goal];
    } else {
      return memo[goal];
    }
  }
}
int main() {
  long long memo[100000] = {};
  int danger[100000];
  int N, M;
  std::vector<long> a;
  std::cin >> N >> M;
  for (int i = 0; i < N + 1; i++) {
    danger[i] = 1;
  }
  for (int i = 0; i < M; i++) {
    int temp;
    std::cin >> temp;
    danger[temp] = 0;
  }
  long long result = 0;
  result = upstair(danger, N, memo);
  std::cout << (result % 1000000007) << std::endl;
  return 0;
}
