#include <bits/stdc++.h>
using namespace std;

int main(){
    int N,M;
    int mod = 1000000007;
    cin >> N >> M;
    int a[M] = {};
    for (int i = 0;i < M;i++){
        cin >> a[i];
    }
    long long c[N] = {};
    if (a[0] == 1) c[0] = 0;
    else c[0] = 1;
    int x = count(a,a + M,2);
    if (x == 1) c[1] = 0;
    else c[1] = c[0] + 1;
    for (int i = 2;i < N;i++){
        x = count(a,a + M,i + 1);
        if (x == 1) c[i] = 0;
        else c[i] = (c[i - 1] + c[i - 2]) % mod;
    }
    cout << c[N - 1] << endl;
}