#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  long long count = 1;
  cin >> N >> M;
  int a[M];
  long long fib_array[N];
  fib_array[0] = 1;
  fib_array[1] = 1;
  for (int i = 2; i <= N; i++) {
    fib_array[i] = (fib_array[i - 1] + fib_array[i - 2]) % 1000000007;
  }
  for (int i = 0; i < M; i++) {
    cin >> a[i];
    if (i == 0) {
      count = fib_array[a[0] - 1] % 1000000007;
    } else {
      if ((a[i] - a[i - 1]) == 1) {
        count = 0;
        break;
      } else {
        count = (count * fib_array[(a[i] - a[i - 1] - 2)]) % 1000000007;
      }
    }
  }
  cout << (count * fib_array[N - a[M - 1] - 1]) % 1000000007 << endl;
}
