#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main(){
    int n;
    cin >> n;
    ll a[n+7] = {0};
    a[0] = 1;
    int m;
    cin >> m;
    for (int i = 0; i < m; i++){
        int t;
        cin >> t;
        a[t] = -1;
    }
    if (a[1] != -1) a[1] = 1;
    else a[1] = 0;
    for (int i = 2; i < n+1; i++){
        if (a[i] == -1) a[i] = 0;
        else a[i] = a[i - 1] + a[i - 2];
    }
    cout << a[n] % 1000000007;
    return 0;
}
