#include <bits/stdc++.h>
using namespace std;
int all_patern(int n) {
  int tmp = 0, tmp1 = 1, tmp2 = 1;
  if (n <= 0) {
    return 1;
  }
  for (int i = 0; i < n; i++) {
    tmp2 = tmp + tmp1;
    tmp = tmp1;
    tmp1 = tmp2;
  }
  return tmp2;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  long int ans = 1;
  long int tmp = 1;
  int j = 0;
  int now_stair = 0;
  for (int i = 0; i < n - 1; i++) {
    if (i == a[j]) {
      tmp = all_patern(now_stair - 1);
      ans = tmp * ans;
      now_stair = 0;
      j++;
    }
    now_stair++;
  }
  tmp = all_patern(now_stair);
  ans = tmp * ans;
  for (int i = 0; i < m - 1; i++) {
    if (a[i] + 1 == a[i + 1]) {
      ans = 0;
      break;
    }
  }
  cout << ans % 1000000007 << endl;
  return 0;
}
