#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000007;
bool check(int a[], int num, int m) {
  bool flag = true;
  for (int i = 0; i < m; ++i) {
    if (a[i] == num) flag = false;
  }
  return flag;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  int a[m];
  for (int i = 0; i < m; ++i) {
    cin >> a[i];
    a[i]--;
  }
  int dp[n];
  memset(dp, 0, sizeof(dp));
  if (check(a, 0, m)) dp[0]++;
  if (check(a, 1, m)) dp[1]++;
  dp[1] += dp[0];
  for (int i = 2; i < n; ++i) {
    if (!check(a, i, m)) continue;
    if (check(a, i - 1, m)) {
      dp[i] += dp[i - 1];
      dp[i] %= INF;
    }
    if (check(a, i - 2, m)) {
      dp[i] += dp[i - 2];
      dp[i] %= INF;
    }
  }
  cout << dp[n - 1] << endl;
  return 0;
}
