#include <bits/stdc++.h>
using namespace std;
bool compare(int i, int j) { return i > j; }
long long solve(int arr[], int i, int M, int N) {
  if (i == N) return 1;
  if (i > N) return 0;
  if (find(arr, arr + M, i) != arr + M) {
    return 0;
  } else {
    return solve(arr, i + 1, M, N) + solve(arr, i + 2, M, N);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N, M;
  cin >> N >> M;
  int arr[M];
  for (int i = 0; i < M; i++) {
    cin >> arr[i];
  }
  long long cnt = 0;
  cnt += solve(arr, 1, M, N);
  cnt += solve(arr, 2, M, N);
  cout << cnt % 1000000007;
  return 0;
}
