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