#include <bits/stdc++.h>
using namespace std;
vector<int> arr;
vector<int> memo;
unsigned long long dp(int index) {
  if (memo[index] != -1) return memo[index];
  if (index == arr.size() - 1 && arr[index] != -1) {
    memo[index] = 1;
    return 1;
  }
  if (arr[index] == -1) {
    memo[index] = 0;
    return 0;
  }
  unsigned long long result = 0;
  if (index <= arr.size() - 2)
    if (arr[index + 1] != -1) result += dp(index + 1);
  if (index <= arr.size() - 3)
    if (arr[index + 2] != -1) result += dp(index + 2);
  memo[index] = result;
  return result;
}
int main() {
  int n;
  int m;
  cin >> n >> m;
  arr.resize(n + 1);
  vector<int> numbers(n + 1);
  memo.resize(n + 2);
  for (int i = 0; i < memo.size(); i++) memo[i] = -1;
  for (int i = 0; i < m; i++) {
    int index;
    cin >> index;
    arr[index] = -1;
  }
  unsigned long long solution = dp(0) % 1000000007;
  cout << solution;
  return 0;
}
