#include <bits/stdc++.h>
using namespace std;
int N, M;
vector<long> a, dp;
int main() {
  long result = 0;
  int flag = 0;
  cin >> N >> M;
  a.resize(M);
  dp.resize(N + 1);
  for (int i = 0; i < M; i++) {
    cin >> a[i];
    if (i > 0) {
      if (a[i] - a[i - 1] == 1) {
        flag = 1;
      }
    }
  }
  long wayToClimb(int position);
  if (flag == 0) {
    result = wayToClimb(0) % 1000000007;
  }
  cout << result << endl;
}
bool check(int position) {
  for (int i = 0; i < M; i++) {
    if (a[i] == position) {
      return true;
    }
  }
  return false;
}
long wayToClimb(int position) {
  if (position == N) {
    return 1;
  } else if (position > N) {
    return 0;
  } else if (check(position)) {
    return 0;
  }
  if (dp[position] > 0) {
    return dp[position];
  }
  long count = 0;
  for (int step = 1; step <= 2; step++) {
    count += wayToClimb(position + step);
  }
  return dp[position] = count;
}
