import java.util.*;

public class Main {


    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();

        int dp[] = new int[n+2];
        boolean stairs[] = new boolean[n+1];
        dp[0] = 0;
        dp[1] = 1;


        int a[] = new int[m];

        for (int i=0; i<m; i++){
            a[i] = sc.nextInt();
            stairs[a[i]] = true;
        }

        for (int j=0; j<n; j++) {
            if (stairs[j+1]) {
                dp[j]=0;
                continue;
            }
            else{
                dp[j + 2] = (dp[j + 1] + dp[j]) % 1000000007;
            }
        }

        System.out.println(dp[n+1]);

    }
}
 import java.util.*; util.* java public class Main {


    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();

        int dp[] = new int[n+2];
        boolean stairs[] = new boolean[n+1];
        dp[0] = 0;
        dp[1] = 1;


        int a[] = new int[m];

        for (int i=0; i<m; i++){
            a[i] = sc.nextInt();
            stairs[a[i]] = true;
        }

        for (int j=0; j<n; j++) {
            if (stairs[j+1]) {
                dp[j]=0;
                continue;
            }
            else{
                dp[j + 2] = (dp[j + 1] + dp[j]) % 1000000007;
            }
        }

        System.out.println(dp[n+1]);

    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();

        int dp[] = new int[n+2];
        boolean stairs[] = new boolean[n+1];
        dp[0] = 0;
        dp[1] = 1;


        int a[] = new int[m];

        for (int i=0; i<m; i++){
            a[i] = sc.nextInt();
            stairs[a[i]] = true;
        }

        for (int j=0; j<n; j++) {
            if (stairs[j+1]) {
                dp[j]=0;
                continue;
            }
            else{
                dp[j + 2] = (dp[j + 1] + dp[j]) % 1000000007;
            }
        }

        System.out.println(dp[n+1]);

    } main {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();

        int dp[] = new int[n+2];
        boolean stairs[] = new boolean[n+1];
        dp[0] = 0;
        dp[1] = 1;


        int a[] = new int[m];

        for (int i=0; i<m; i++){
            a[i] = sc.nextInt();
            stairs[a[i]] = true;
        }

        for (int j=0; j<n; j++) {
            if (stairs[j+1]) {
                dp[j]=0;
                continue;
            }
            else{
                dp[j + 2] = (dp[j + 1] + dp[j]) % 1000000007;
            }
        }

        System.out.println(dp[n+1]);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int dp[] = new int[n+2]; dp new int[n+2] n+2 n 2 boolean stairs[] = new boolean[n+1]; stairs new boolean[n+1] n+1 n 1 dp[0] = 0 dp[0] dp 0 0 dp[1] = 1 dp[1] dp 1 1 int a[] = new int[m]; a new int[m] m for (int i=0; i<m; i++){
            a[i] = sc.nextInt();
            stairs[a[i]] = true;
        } int i=0; int i=0; i 0 i<m i m i++ i++ i {
            a[i] = sc.nextInt();
            stairs[a[i]] = true;
        } {
            a[i] = sc.nextInt();
            stairs[a[i]] = true;
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc stairs[a[i]] = true stairs[a[i]] stairs a[i] a i true for (int j=0; j<n; j++) {
            if (stairs[j+1]) {
                dp[j]=0;
                continue;
            }
            else{
                dp[j + 2] = (dp[j + 1] + dp[j]) % 1000000007;
            }
        } int j=0; int j=0; j 0 j<n j n j++ j++ j {
            if (stairs[j+1]) {
                dp[j]=0;
                continue;
            }
            else{
                dp[j + 2] = (dp[j + 1] + dp[j]) % 1000000007;
            }
        } {
            if (stairs[j+1]) {
                dp[j]=0;
                continue;
            }
            else{
                dp[j + 2] = (dp[j + 1] + dp[j]) % 1000000007;
            }
        } if (stairs[j+1]) {
                dp[j]=0;
                continue;
            }
            else{
                dp[j + 2] = (dp[j + 1] + dp[j]) % 1000000007;
            } stairs[j+1] stairs j+1 j 1 {
                dp[j]=0;
                continue;
            } dp[j]=0 dp[j] dp j 0 continue; {
                dp[j + 2] = (dp[j + 1] + dp[j]) % 1000000007;
            } dp[j + 2] = (dp[j + 1] + dp[j]) % 1000000007 dp[j + 2] dp j + 2 j 2 (dp[j + 1] + dp[j]) % 1000000007 (dp[j + 1] + dp[j]) dp[j + 1] dp j + 1 j 1 dp[j] dp j 1000000007 System.out.println(dp[n+1]) System.out.println System.out System System.out dp[n+1] dp n+1 n 1 String[] args args public class Main {


    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();

        int dp[] = new int[n+2];
        boolean stairs[] = new boolean[n+1];
        dp[0] = 0;
        dp[1] = 1;


        int a[] = new int[m];

        for (int i=0; i<m; i++){
            a[i] = sc.nextInt();
            stairs[a[i]] = true;
        }

        for (int j=0; j<n; j++) {
            if (stairs[j+1]) {
                dp[j]=0;
                continue;
            }
            else{
                dp[j + 2] = (dp[j + 1] + dp[j]) % 1000000007;
            }
        }

        System.out.println(dp[n+1]);

    }
} public class Main {


    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();

        int dp[] = new int[n+2];
        boolean stairs[] = new boolean[n+1];
        dp[0] = 0;
        dp[1] = 1;


        int a[] = new int[m];

        for (int i=0; i<m; i++){
            a[i] = sc.nextInt();
            stairs[a[i]] = true;
        }

        for (int j=0; j<n; j++) {
            if (stairs[j+1]) {
                dp[j]=0;
                continue;
            }
            else{
                dp[j + 2] = (dp[j + 1] + dp[j]) % 1000000007;
            }
        }

        System.out.println(dp[n+1]);

    }
} Main
import java.util.*;

public class Main {


    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();

        int dp[] = new int[n+2];
        boolean stairs[] = new boolean[n+1];
        dp[0] = 0;
        dp[1] = 1;


        int a[] = new int[m];

        for (int i=0; i<m; i++){
            a[i] = sc.nextInt();
            stairs[a[i]] = true;
        }

        for (int j=0; j<n; j++) {
            if (stairs[j+1]) {
                dp[j]=0;
                continue;
            }
            else{
                dp[j + 2] = (dp[j + 1] + dp[j]) % 1000000007;
            }
        }

        System.out.println(dp[n+1]);

    }
}

