#include <iostream>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <list>
using namespace std;

const long long DIV = 1e9+7;
const int NMAX = 1e5;
long long dp[NMAX] = {};

int main(){

    int n, m;
    cin >> n >> m;

    int a[m];
    int c[n] = {};

    for(int i=0; i<m; i++){
        cin >> a[i];
    }


    int i=0;
    for(int j=0; j<n; j++){
        if(j == a[i]){
            c[j] = 1;
            i++;
            if(i == m){
                break;
            }
        }
    }

    dp[0] = 1;
    dp[1] = 1;

    bool isNG = false;
    for(int i=2; i<n+1; i++){

        if(c[i] == 1 && c[i-1] == 1){
            isNG = true;
            break;
        } 

        if(c[i-1] == 1){
            dp[i] = dp[i-2];
            cout << i << ":(1) " << dp[i] << endl;
        }
        else if(c[i-2] == 1){
            dp[i] = dp[i-1];
            cout << i << ":(2) " << dp[i] << endl;
        }
        else{
            dp[i] = (dp[i-1] + dp[i-2]) % DIV;
            cout << i << ":(3) " << dp[i] << endl;
        }
    }

    // cout << endl;
    // for(int i=0; i<n+1; i++){
    //     cout << dp[i] << endl;
    // }
    // cout << endl;
    
    if(isNG){
        cout << 0 << endl;
    }
    else{
        cout << dp[n] << endl;
    }




    return 0;
}