import java.util.Arrays;
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[] broken = new boolean[n + 1];
        for (int i = 0; i < m; i++) {
            broken[sc.nextInt()] = true;
        }

        // 累積和的にDPする。抜けた段は0でSKIP
        int[] dp = new int[n + 1];
        Arrays.fill(dp, 0);
        dp[0] = 1;
        dp[1] = broken[1] ? 0 : 1; // 最初の段が壊れている可能性

        for (int i = 2; i <= n; i++) {
            if (broken[i]) {
                continue;
            }
            dp[i] = dp[i - 1] + dp[i - 2]; // 遷移元を累積和
            dp[i] %= 1000000007;
        }

        // 2段連続で壊れていないか
        boolean canNotUpStairs = false;
        for (int i = 1; i < broken.length; i++) {
            if (broken[i - 1] && broken[i]) {
                canNotUpStairs = true;
            }
        }

        if (canNotUpStairs) {
            System.out.println(0);
        } else {
            System.out.println(dp[dp.length - 1]);
        }
    }
} import java.util.Arrays; Arrays java.util 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[] broken = new boolean[n + 1];
        for (int i = 0; i < m; i++) {
            broken[sc.nextInt()] = true;
        }

        // 累積和的にDPする。抜けた段は0でSKIP
        int[] dp = new int[n + 1];
        Arrays.fill(dp, 0);
        dp[0] = 1;
        dp[1] = broken[1] ? 0 : 1; // 最初の段が壊れている可能性

        for (int i = 2; i <= n; i++) {
            if (broken[i]) {
                continue;
            }
            dp[i] = dp[i - 1] + dp[i - 2]; // 遷移元を累積和
            dp[i] %= 1000000007;
        }

        // 2段連続で壊れていないか
        boolean canNotUpStairs = false;
        for (int i = 1; i < broken.length; i++) {
            if (broken[i - 1] && broken[i]) {
                canNotUpStairs = true;
            }
        }

        if (canNotUpStairs) {
            System.out.println(0);
        } else {
            System.out.println(dp[dp.length - 1]);
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        boolean[] broken = new boolean[n + 1];
        for (int i = 0; i < m; i++) {
            broken[sc.nextInt()] = true;
        }

        // 累積和的にDPする。抜けた段は0でSKIP
        int[] dp = new int[n + 1];
        Arrays.fill(dp, 0);
        dp[0] = 1;
        dp[1] = broken[1] ? 0 : 1; // 最初の段が壊れている可能性

        for (int i = 2; i <= n; i++) {
            if (broken[i]) {
                continue;
            }
            dp[i] = dp[i - 1] + dp[i - 2]; // 遷移元を累積和
            dp[i] %= 1000000007;
        }

        // 2段連続で壊れていないか
        boolean canNotUpStairs = false;
        for (int i = 1; i < broken.length; i++) {
            if (broken[i - 1] && broken[i]) {
                canNotUpStairs = true;
            }
        }

        if (canNotUpStairs) {
            System.out.println(0);
        } else {
            System.out.println(dp[dp.length - 1]);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        boolean[] broken = new boolean[n + 1];
        for (int i = 0; i < m; i++) {
            broken[sc.nextInt()] = true;
        }

        // 累積和的にDPする。抜けた段は0でSKIP
        int[] dp = new int[n + 1];
        Arrays.fill(dp, 0);
        dp[0] = 1;
        dp[1] = broken[1] ? 0 : 1; // 最初の段が壊れている可能性

        for (int i = 2; i <= n; i++) {
            if (broken[i]) {
                continue;
            }
            dp[i] = dp[i - 1] + dp[i - 2]; // 遷移元を累積和
            dp[i] %= 1000000007;
        }

        // 2段連続で壊れていないか
        boolean canNotUpStairs = false;
        for (int i = 1; i < broken.length; i++) {
            if (broken[i - 1] && broken[i]) {
                canNotUpStairs = true;
            }
        }

        if (canNotUpStairs) {
            System.out.println(0);
        } else {
            System.out.println(dp[dp.length - 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 boolean[] broken = new boolean[n + 1]; broken new boolean[n + 1] n + 1 n 1 for (int i = 0; i < m; i++) {
            broken[sc.nextInt()] = true;
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            broken[sc.nextInt()] = true;
        } {
            broken[sc.nextInt()] = true;
        } broken[sc.nextInt()] = true broken[sc.nextInt()] broken sc.nextInt() sc.nextInt sc true int[] dp = new int[n + 1]; dp new int[n + 1] n + 1 n 1 Arrays.fill(dp, 0) Arrays.fill Arrays dp 0 dp[0] = 1 dp[0] dp 0 1 dp[1] = broken[1] ? 0 : 1 dp[1] dp 1 broken[1] ? 0 : 1 broken[1] broken 1 0 1 for (int i = 2; i <= n; i++) {
            if (broken[i]) {
                continue;
            }
            dp[i] = dp[i - 1] + dp[i - 2]; // 遷移元を累積和
            dp[i] %= 1000000007;
        } int i = 2; int i = 2; i 2 i <= n i n i++ i++ i {
            if (broken[i]) {
                continue;
            }
            dp[i] = dp[i - 1] + dp[i - 2]; // 遷移元を累積和
            dp[i] %= 1000000007;
        } {
            if (broken[i]) {
                continue;
            }
            dp[i] = dp[i - 1] + dp[i - 2]; // 遷移元を累積和
            dp[i] %= 1000000007;
        } if (broken[i]) {
                continue;
            } broken[i] broken i {
                continue;
            } continue; dp[i] = dp[i - 1] + dp[i - 2] dp[i] dp i dp[i - 1] + dp[i - 2] dp[i - 1] dp i - 1 i 1 dp[i - 2] dp i - 2 i 2 dp[i] %= 1000000007 dp[i] dp i 1000000007 boolean canNotUpStairs = false; canNotUpStairs false for (int i = 1; i < broken.length; i++) {
            if (broken[i - 1] && broken[i]) {
                canNotUpStairs = true;
            }
        } int i = 1; int i = 1; i 1 i < broken.length i broken.length broken broken.length i++ i++ i {
            if (broken[i - 1] && broken[i]) {
                canNotUpStairs = true;
            }
        } {
            if (broken[i - 1] && broken[i]) {
                canNotUpStairs = true;
            }
        } if (broken[i - 1] && broken[i]) {
                canNotUpStairs = true;
            } broken[i - 1] && broken[i] broken[i - 1] broken i - 1 i 1 broken[i] broken i {
                canNotUpStairs = true;
            } canNotUpStairs = true canNotUpStairs true if (canNotUpStairs) {
            System.out.println(0);
        } else {
            System.out.println(dp[dp.length - 1]);
        } canNotUpStairs {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 {
            System.out.println(dp[dp.length - 1]);
        } System.out.println(dp[dp.length - 1]) System.out.println System.out System System.out dp[dp.length - 1] dp dp.length - 1 dp.length dp dp.length 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();
        boolean[] broken = new boolean[n + 1];
        for (int i = 0; i < m; i++) {
            broken[sc.nextInt()] = true;
        }

        // 累積和的にDPする。抜けた段は0でSKIP
        int[] dp = new int[n + 1];
        Arrays.fill(dp, 0);
        dp[0] = 1;
        dp[1] = broken[1] ? 0 : 1; // 最初の段が壊れている可能性

        for (int i = 2; i <= n; i++) {
            if (broken[i]) {
                continue;
            }
            dp[i] = dp[i - 1] + dp[i - 2]; // 遷移元を累積和
            dp[i] %= 1000000007;
        }

        // 2段連続で壊れていないか
        boolean canNotUpStairs = false;
        for (int i = 1; i < broken.length; i++) {
            if (broken[i - 1] && broken[i]) {
                canNotUpStairs = true;
            }
        }

        if (canNotUpStairs) {
            System.out.println(0);
        } else {
            System.out.println(dp[dp.length - 1]);
        }
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        boolean[] broken = new boolean[n + 1];
        for (int i = 0; i < m; i++) {
            broken[sc.nextInt()] = true;
        }

        // 累積和的にDPする。抜けた段は0でSKIP
        int[] dp = new int[n + 1];
        Arrays.fill(dp, 0);
        dp[0] = 1;
        dp[1] = broken[1] ? 0 : 1; // 最初の段が壊れている可能性

        for (int i = 2; i <= n; i++) {
            if (broken[i]) {
                continue;
            }
            dp[i] = dp[i - 1] + dp[i - 2]; // 遷移元を累積和
            dp[i] %= 1000000007;
        }

        // 2段連続で壊れていないか
        boolean canNotUpStairs = false;
        for (int i = 1; i < broken.length; i++) {
            if (broken[i - 1] && broken[i]) {
                canNotUpStairs = true;
            }
        }

        if (canNotUpStairs) {
            System.out.println(0);
        } else {
            System.out.println(dp[dp.length - 1]);
        }
    }
} Main
import java.util.Arrays;
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[] broken = new boolean[n + 1];
        for (int i = 0; i < m; i++) {
            broken[sc.nextInt()] = true;
        }

        // 累積和的にDPする。抜けた段は0でSKIP
        int[] dp = new int[n + 1];
        Arrays.fill(dp, 0);
        dp[0] = 1;
        dp[1] = broken[1] ? 0 : 1; // 最初の段が壊れている可能性

        for (int i = 2; i <= n; i++) {
            if (broken[i]) {
                continue;
            }
            dp[i] = dp[i - 1] + dp[i - 2]; // 遷移元を累積和
            dp[i] %= 1000000007;
        }

        // 2段連続で壊れていないか
        boolean canNotUpStairs = false;
        for (int i = 1; i < broken.length; i++) {
            if (broken[i - 1] && broken[i]) {
                canNotUpStairs = true;
            }
        }

        if (canNotUpStairs) {
            System.out.println(0);
        } else {
            System.out.println(dp[dp.length - 1]);
        }
    }
}
