#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> a(0);
vector<int> memo(0);
vector<int> not_in_memo(0);
int last = 0;
int notin(int value) {
  if (not_in_memo.at(value) == -1) {
    not_in_memo.at(value) = find(a.begin(), a.end(), value) == a.end();
  }
  return not_in_memo.at(value);
}
int dp(int i) {
  if (i == n - 1) {
    return 1;
  }
  if (i == n - 2) {
    return 1 + notin(n - 1);
  }
  if (memo.at(i) != -1) {
    return memo.at(i);
  }
  memo.at(i) = (dp(i + 1) * notin(i + 1) % 1000000007 +
                dp(i + 2) * notin(i + 2) % 1000000007) %
               1000000007;
  return memo.at(i);
}
int main() {
  cin >> n >> m;
  a = vector<int>(m);
  memo = vector<int>(n, -1);
  not_in_memo = vector<int>(n, -1);
  last = m - 1;
  for (int i = 0; i < (int)(m); i++) {
    cin >> a.at(i);
  }
  cout << dp(0) << endl;
  return 0;
}
