#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, M;
  cin >> N >> M;
  int check[M + 1];
  int INF = 1000000007;
  long long int ans[N + 1];
  ans[0] = 1;
  ans[1] = 1;
  int count = 0;
  for (int i = 0; i < M; i++) cin >> check[i];
  check[M] = check[M - 1];
  for (int i = 1; i <= N; i++) {
    if (i == check[count]) {
      ans[i + 1] = ans[i - 1];
      count++;
      i++;
    } else if (i != check[count] && i >= 2) {
      if (i - 2 == check[count - 1])
        ans[i] = ans[i - 1];
      else
        ans[i] = (ans[i - 1] + ans[i - 2]) % INF;
    }
  }
  for (int i = 1; i < M; i++) {
    if (check[i - 1] == check[i] - 1) ans[N] = 0;
  }
  cout << ans[N] << endl;
  return 0;
}
