import java.util.Scanner;

public class Main {

    public static void main(String[] args){

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        boolean[] b = new boolean[n+1];
        long[] a = new long[n+1];
        long mod = 1_000_000_007;

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

        a[0] = 1;
        if(!b[1]) a[1] = 1;


        for(int i=2; i<=n; i++) {
            if(b[i]) continue;
            a[i] = a[i-2] + a[i-1];
            a[i] %= mod;
        }

        System.out.println(a[n]);

    }

} import java.util.Scanner; Scanner 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();
        boolean[] b = new boolean[n+1];
        long[] a = new long[n+1];
        long mod = 1_000_000_007;

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

        a[0] = 1;
        if(!b[1]) a[1] = 1;


        for(int i=2; i<=n; i++) {
            if(b[i]) continue;
            a[i] = a[i-2] + a[i-1];
            a[i] %= mod;
        }

        System.out.println(a[n]);

    }

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

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        boolean[] b = new boolean[n+1];
        long[] a = new long[n+1];
        long mod = 1_000_000_007;

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

        a[0] = 1;
        if(!b[1]) a[1] = 1;


        for(int i=2; i<=n; i++) {
            if(b[i]) continue;
            a[i] = a[i-2] + a[i-1];
            a[i] %= mod;
        }

        System.out.println(a[n]);

    } main {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        boolean[] b = new boolean[n+1];
        long[] a = new long[n+1];
        long mod = 1_000_000_007;

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

        a[0] = 1;
        if(!b[1]) a[1] = 1;


        for(int i=2; i<=n; i++) {
            if(b[i]) continue;
            a[i] = a[i-2] + a[i-1];
            a[i] %= mod;
        }

        System.out.println(a[n]);

    } 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 boolean[] b = new boolean[n+1]; b new boolean[n+1] n+1 n 1 long[] a = new long[n+1]; a new long[n+1] n+1 n 1 long mod = 1_000_000_007; mod 1_000_000_007 for(int i=0; i<m; i++) {
            b[sc.nextInt()] = true;
        } int i=0; int i=0; i 0 i<m i m i++ i++ i {
            b[sc.nextInt()] = true;
        } {
            b[sc.nextInt()] = true;
        } b[sc.nextInt()] = true b[sc.nextInt()] b sc.nextInt() sc.nextInt sc true a[0] = 1 a[0] a 0 1 if(!b[1]) a[1] = 1; !b[1] b[1] b 1 a[1] = 1 a[1] a 1 1 for(int i=2; i<=n; i++) {
            if(b[i]) continue;
            a[i] = a[i-2] + a[i-1];
            a[i] %= mod;
        } int i=2; int i=2; i 2 i<=n i n i++ i++ i {
            if(b[i]) continue;
            a[i] = a[i-2] + a[i-1];
            a[i] %= mod;
        } {
            if(b[i]) continue;
            a[i] = a[i-2] + a[i-1];
            a[i] %= mod;
        } if(b[i]) continue; b[i] b i continue; a[i] = a[i-2] + a[i-1] a[i] a i a[i-2] + a[i-1] a[i-2] a i-2 i 2 a[i-1] a i-1 i 1 a[i] %= mod a[i] a i mod System.out.println(a[n]) System.out.println System.out System System.out a[n] a n 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();
        boolean[] b = new boolean[n+1];
        long[] a = new long[n+1];
        long mod = 1_000_000_007;

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

        a[0] = 1;
        if(!b[1]) a[1] = 1;


        for(int i=2; i<=n; i++) {
            if(b[i]) continue;
            a[i] = a[i-2] + a[i-1];
            a[i] %= mod;
        }

        System.out.println(a[n]);

    }

} public class Main {

    public static void main(String[] args){

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        boolean[] b = new boolean[n+1];
        long[] a = new long[n+1];
        long mod = 1_000_000_007;

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

        a[0] = 1;
        if(!b[1]) a[1] = 1;


        for(int i=2; i<=n; i++) {
            if(b[i]) continue;
            a[i] = a[i-2] + a[i-1];
            a[i] %= mod;
        }

        System.out.println(a[n]);

    }

} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args){

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        boolean[] b = new boolean[n+1];
        long[] a = new long[n+1];
        long mod = 1_000_000_007;

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

        a[0] = 1;
        if(!b[1]) a[1] = 1;


        for(int i=2; i<=n; i++) {
            if(b[i]) continue;
            a[i] = a[i-2] + a[i-1];
            a[i] %= mod;
        }

        System.out.println(a[n]);

    }

}
