import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

    private static final int MOD = 1_000_000_007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        Set<Integer> a = new HashSet<>();
        for (int i = 0; i < m; i++) {
            a.add(sc.nextInt());
        }

        int[] dp = new int[n + 1];
        dp[0] = 1;
        dp[1] = 1;
        if (a.contains(1)) {
            dp[1] = 0;
        }
        for (int i = 2; i <= n; i++) {
            if (a.contains(i)) {
                dp[i] = 0;
                continue;
            }
            dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
        }
        System.out.println(dp[n]);
    }

} import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {

    private static final int MOD = 1_000_000_007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        Set<Integer> a = new HashSet<>();
        for (int i = 0; i < m; i++) {
            a.add(sc.nextInt());
        }

        int[] dp = new int[n + 1];
        dp[0] = 1;
        dp[1] = 1;
        if (a.contains(1)) {
            dp[1] = 0;
        }
        for (int i = 2; i <= n; i++) {
            if (a.contains(i)) {
                dp[i] = 0;
                continue;
            }
            dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
        }
        System.out.println(dp[n]);
    }

} Main private static final int MOD = 1_000_000_007; MOD 1_000_000_007 public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        Set<Integer> a = new HashSet<>();
        for (int i = 0; i < m; i++) {
            a.add(sc.nextInt());
        }

        int[] dp = new int[n + 1];
        dp[0] = 1;
        dp[1] = 1;
        if (a.contains(1)) {
            dp[1] = 0;
        }
        for (int i = 2; i <= n; i++) {
            if (a.contains(i)) {
                dp[i] = 0;
                continue;
            }
            dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
        }
        System.out.println(dp[n]);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        Set<Integer> a = new HashSet<>();
        for (int i = 0; i < m; i++) {
            a.add(sc.nextInt());
        }

        int[] dp = new int[n + 1];
        dp[0] = 1;
        dp[1] = 1;
        if (a.contains(1)) {
            dp[1] = 0;
        }
        for (int i = 2; i <= n; i++) {
            if (a.contains(i)) {
                dp[i] = 0;
                continue;
            }
            dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
        }
        System.out.println(dp[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 Set<Integer> a = new HashSet<>(); a new HashSet<>() for (int i = 0; i < m; i++) {
            a.add(sc.nextInt());
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            a.add(sc.nextInt());
        } {
            a.add(sc.nextInt());
        } a.add(sc.nextInt()) a.add a sc.nextInt() sc.nextInt sc int[] dp = new int[n + 1]; dp new int[n + 1] n + 1 n 1 dp[0] = 1 dp[0] dp 0 1 dp[1] = 1 dp[1] dp 1 1 if (a.contains(1)) {
            dp[1] = 0;
        } a.contains(1) a.contains a 1 {
            dp[1] = 0;
        } dp[1] = 0 dp[1] dp 1 0 for (int i = 2; i <= n; i++) {
            if (a.contains(i)) {
                dp[i] = 0;
                continue;
            }
            dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
        } int i = 2; int i = 2; i 2 i <= n i n i++ i++ i {
            if (a.contains(i)) {
                dp[i] = 0;
                continue;
            }
            dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
        } {
            if (a.contains(i)) {
                dp[i] = 0;
                continue;
            }
            dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
        } if (a.contains(i)) {
                dp[i] = 0;
                continue;
            } a.contains(i) a.contains a i {
                dp[i] = 0;
                continue;
            } dp[i] = 0 dp[i] dp i 0 continue; dp[i] = (dp[i - 1] + dp[i - 2]) % MOD dp[i] dp i (dp[i - 1] + dp[i - 2]) % MOD (dp[i - 1] + dp[i - 2]) dp[i - 1] dp i - 1 i 1 dp[i - 2] dp i - 2 i 2 MOD System.out.println(dp[n]) System.out.println System.out System System.out dp[n] dp n String[] args args public class Main {

    private static final int MOD = 1_000_000_007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        Set<Integer> a = new HashSet<>();
        for (int i = 0; i < m; i++) {
            a.add(sc.nextInt());
        }

        int[] dp = new int[n + 1];
        dp[0] = 1;
        dp[1] = 1;
        if (a.contains(1)) {
            dp[1] = 0;
        }
        for (int i = 2; i <= n; i++) {
            if (a.contains(i)) {
                dp[i] = 0;
                continue;
            }
            dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
        }
        System.out.println(dp[n]);
    }

} public class Main {

    private static final int MOD = 1_000_000_007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        Set<Integer> a = new HashSet<>();
        for (int i = 0; i < m; i++) {
            a.add(sc.nextInt());
        }

        int[] dp = new int[n + 1];
        dp[0] = 1;
        dp[1] = 1;
        if (a.contains(1)) {
            dp[1] = 0;
        }
        for (int i = 2; i <= n; i++) {
            if (a.contains(i)) {
                dp[i] = 0;
                continue;
            }
            dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
        }
        System.out.println(dp[n]);
    }

} Main
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

    private static final int MOD = 1_000_000_007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        Set<Integer> a = new HashSet<>();
        for (int i = 0; i < m; i++) {
            a.add(sc.nextInt());
        }

        int[] dp = new int[n + 1];
        dp[0] = 1;
        dp[1] = 1;
        if (a.contains(1)) {
            dp[1] = 0;
        }
        for (int i = 2; i <= n; i++) {
            if (a.contains(i)) {
                dp[i] = 0;
                continue;
            }
            dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
        }
        System.out.println(dp[n]);
    }

}
