import java.io.File;
import java.io.FileNotFoundException;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws FileNotFoundException {
        Scanner s = new Scanner(System.in);

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

        int[] arr = new int[m];
        int prev1 = -1;
        for (int i = 0; i < m; i++) {
            int broken = s.nextInt();
            if (broken == prev1 + 1) {
                System.out.println(0);
                return;
            }
            arr[i] = prev1 = broken;
        }
        if (arr.length == 0) {
            ArrayList<BigInteger> fiboArr = new ArrayList<>(n * 2);
            fiboArr.add(BigInteger.valueOf(1));
            fiboArr.add(BigInteger.valueOf(1));
            fiboArr.add(BigInteger.valueOf(2));
            fiboArr.add(BigInteger.valueOf(3));
            fiboArr.add(BigInteger.valueOf(5));
            fiboArr.add(BigInteger.valueOf(8));
            fiboArr.add(BigInteger.valueOf(13));
            fiboArr.add(BigInteger.valueOf(21));
            fiboArr.add(BigInteger.valueOf(34));

            BigInteger aaa = BigInteger.valueOf(1000000007);
            BigInteger answer = fibo(fiboArr, n + 1);
            answer = answer.mod(aaa);

            System.out.println(answer.longValue());
            return;
        }

        int prev2;
        int[] renzoku = new int[m + 1];
        renzoku[0] = arr[0];
        int maxRen = arr[0];
        prev2 = arr[0];
        for (int i = 1; i < m; i++) {
            int next = arr[i];
            renzoku[i] = next - prev2 - 1;
            maxRen = Math.max(maxRen, renzoku[i]);
            prev2 = next;
        }
        renzoku[m] = n - prev2;
        maxRen = Math.max(maxRen, renzoku[m]);

        // 1: 1
        // 2: 1
        // 3: 2
        // 4: 3
        // 5: 5
        // 6: 8

        ArrayList<BigInteger> fiboArr = new ArrayList<>(maxRen * 2);
        fiboArr.add(BigInteger.valueOf(1));
        fiboArr.add(BigInteger.valueOf(1));
        fiboArr.add(BigInteger.valueOf(2));
        fiboArr.add(BigInteger.valueOf(3));
        fiboArr.add(BigInteger.valueOf(5));
        fiboArr.add(BigInteger.valueOf(8));
        fiboArr.add(BigInteger.valueOf(13));
        fiboArr.add(BigInteger.valueOf(21));
        fiboArr.add(BigInteger.valueOf(34));

        BigInteger answer = BigInteger.valueOf(1);
        BigInteger aaa = BigInteger.valueOf(1000000007);
        for (int i = 0; i < m + 1; i++) {
            answer = answer.multiply(fibo(fiboArr, renzoku[i]));
            answer = answer.mod(aaa);
        }

        System.out.println(answer.longValue());
    }

    private static BigInteger fibo(ArrayList<BigInteger> temp, int _i) {
        int i = _i - 1;
        if (temp.size() > i) {
            return temp.get(i);
        }
        int last = temp.size();

        for (int i1 = last; i1 <= i; i1++) {
            temp.add(temp.get(i1 - 2).add(temp.get(i1 - 1)));
        }
        return temp.get(i);
    }
} import java.io.File; File java.io import java.io.FileNotFoundException; FileNotFoundException java.io import java.math.BigInteger; BigInteger java.math import java.util.ArrayList; ArrayList java.util import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) throws FileNotFoundException {
        Scanner s = new Scanner(System.in);

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

        int[] arr = new int[m];
        int prev1 = -1;
        for (int i = 0; i < m; i++) {
            int broken = s.nextInt();
            if (broken == prev1 + 1) {
                System.out.println(0);
                return;
            }
            arr[i] = prev1 = broken;
        }
        if (arr.length == 0) {
            ArrayList<BigInteger> fiboArr = new ArrayList<>(n * 2);
            fiboArr.add(BigInteger.valueOf(1));
            fiboArr.add(BigInteger.valueOf(1));
            fiboArr.add(BigInteger.valueOf(2));
            fiboArr.add(BigInteger.valueOf(3));
            fiboArr.add(BigInteger.valueOf(5));
            fiboArr.add(BigInteger.valueOf(8));
            fiboArr.add(BigInteger.valueOf(13));
            fiboArr.add(BigInteger.valueOf(21));
            fiboArr.add(BigInteger.valueOf(34));

            BigInteger aaa = BigInteger.valueOf(1000000007);
            BigInteger answer = fibo(fiboArr, n + 1);
            answer = answer.mod(aaa);

            System.out.println(answer.longValue());
            return;
        }

        int prev2;
        int[] renzoku = new int[m + 1];
        renzoku[0] = arr[0];
        int maxRen = arr[0];
        prev2 = arr[0];
        for (int i = 1; i < m; i++) {
            int next = arr[i];
            renzoku[i] = next - prev2 - 1;
            maxRen = Math.max(maxRen, renzoku[i]);
            prev2 = next;
        }
        renzoku[m] = n - prev2;
        maxRen = Math.max(maxRen, renzoku[m]);

        // 1: 1
        // 2: 1
        // 3: 2
        // 4: 3
        // 5: 5
        // 6: 8

        ArrayList<BigInteger> fiboArr = new ArrayList<>(maxRen * 2);
        fiboArr.add(BigInteger.valueOf(1));
        fiboArr.add(BigInteger.valueOf(1));
        fiboArr.add(BigInteger.valueOf(2));
        fiboArr.add(BigInteger.valueOf(3));
        fiboArr.add(BigInteger.valueOf(5));
        fiboArr.add(BigInteger.valueOf(8));
        fiboArr.add(BigInteger.valueOf(13));
        fiboArr.add(BigInteger.valueOf(21));
        fiboArr.add(BigInteger.valueOf(34));

        BigInteger answer = BigInteger.valueOf(1);
        BigInteger aaa = BigInteger.valueOf(1000000007);
        for (int i = 0; i < m + 1; i++) {
            answer = answer.multiply(fibo(fiboArr, renzoku[i]));
            answer = answer.mod(aaa);
        }

        System.out.println(answer.longValue());
    }

    private static BigInteger fibo(ArrayList<BigInteger> temp, int _i) {
        int i = _i - 1;
        if (temp.size() > i) {
            return temp.get(i);
        }
        int last = temp.size();

        for (int i1 = last; i1 <= i; i1++) {
            temp.add(temp.get(i1 - 2).add(temp.get(i1 - 1)));
        }
        return temp.get(i);
    }
} Main public static void main(String[] args) throws FileNotFoundException {
        Scanner s = new Scanner(System.in);

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

        int[] arr = new int[m];
        int prev1 = -1;
        for (int i = 0; i < m; i++) {
            int broken = s.nextInt();
            if (broken == prev1 + 1) {
                System.out.println(0);
                return;
            }
            arr[i] = prev1 = broken;
        }
        if (arr.length == 0) {
            ArrayList<BigInteger> fiboArr = new ArrayList<>(n * 2);
            fiboArr.add(BigInteger.valueOf(1));
            fiboArr.add(BigInteger.valueOf(1));
            fiboArr.add(BigInteger.valueOf(2));
            fiboArr.add(BigInteger.valueOf(3));
            fiboArr.add(BigInteger.valueOf(5));
            fiboArr.add(BigInteger.valueOf(8));
            fiboArr.add(BigInteger.valueOf(13));
            fiboArr.add(BigInteger.valueOf(21));
            fiboArr.add(BigInteger.valueOf(34));

            BigInteger aaa = BigInteger.valueOf(1000000007);
            BigInteger answer = fibo(fiboArr, n + 1);
            answer = answer.mod(aaa);

            System.out.println(answer.longValue());
            return;
        }

        int prev2;
        int[] renzoku = new int[m + 1];
        renzoku[0] = arr[0];
        int maxRen = arr[0];
        prev2 = arr[0];
        for (int i = 1; i < m; i++) {
            int next = arr[i];
            renzoku[i] = next - prev2 - 1;
            maxRen = Math.max(maxRen, renzoku[i]);
            prev2 = next;
        }
        renzoku[m] = n - prev2;
        maxRen = Math.max(maxRen, renzoku[m]);

        // 1: 1
        // 2: 1
        // 3: 2
        // 4: 3
        // 5: 5
        // 6: 8

        ArrayList<BigInteger> fiboArr = new ArrayList<>(maxRen * 2);
        fiboArr.add(BigInteger.valueOf(1));
        fiboArr.add(BigInteger.valueOf(1));
        fiboArr.add(BigInteger.valueOf(2));
        fiboArr.add(BigInteger.valueOf(3));
        fiboArr.add(BigInteger.valueOf(5));
        fiboArr.add(BigInteger.valueOf(8));
        fiboArr.add(BigInteger.valueOf(13));
        fiboArr.add(BigInteger.valueOf(21));
        fiboArr.add(BigInteger.valueOf(34));

        BigInteger answer = BigInteger.valueOf(1);
        BigInteger aaa = BigInteger.valueOf(1000000007);
        for (int i = 0; i < m + 1; i++) {
            answer = answer.multiply(fibo(fiboArr, renzoku[i]));
            answer = answer.mod(aaa);
        }

        System.out.println(answer.longValue());
    } main {
        Scanner s = new Scanner(System.in);

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

        int[] arr = new int[m];
        int prev1 = -1;
        for (int i = 0; i < m; i++) {
            int broken = s.nextInt();
            if (broken == prev1 + 1) {
                System.out.println(0);
                return;
            }
            arr[i] = prev1 = broken;
        }
        if (arr.length == 0) {
            ArrayList<BigInteger> fiboArr = new ArrayList<>(n * 2);
            fiboArr.add(BigInteger.valueOf(1));
            fiboArr.add(BigInteger.valueOf(1));
            fiboArr.add(BigInteger.valueOf(2));
            fiboArr.add(BigInteger.valueOf(3));
            fiboArr.add(BigInteger.valueOf(5));
            fiboArr.add(BigInteger.valueOf(8));
            fiboArr.add(BigInteger.valueOf(13));
            fiboArr.add(BigInteger.valueOf(21));
            fiboArr.add(BigInteger.valueOf(34));

            BigInteger aaa = BigInteger.valueOf(1000000007);
            BigInteger answer = fibo(fiboArr, n + 1);
            answer = answer.mod(aaa);

            System.out.println(answer.longValue());
            return;
        }

        int prev2;
        int[] renzoku = new int[m + 1];
        renzoku[0] = arr[0];
        int maxRen = arr[0];
        prev2 = arr[0];
        for (int i = 1; i < m; i++) {
            int next = arr[i];
            renzoku[i] = next - prev2 - 1;
            maxRen = Math.max(maxRen, renzoku[i]);
            prev2 = next;
        }
        renzoku[m] = n - prev2;
        maxRen = Math.max(maxRen, renzoku[m]);

        // 1: 1
        // 2: 1
        // 3: 2
        // 4: 3
        // 5: 5
        // 6: 8

        ArrayList<BigInteger> fiboArr = new ArrayList<>(maxRen * 2);
        fiboArr.add(BigInteger.valueOf(1));
        fiboArr.add(BigInteger.valueOf(1));
        fiboArr.add(BigInteger.valueOf(2));
        fiboArr.add(BigInteger.valueOf(3));
        fiboArr.add(BigInteger.valueOf(5));
        fiboArr.add(BigInteger.valueOf(8));
        fiboArr.add(BigInteger.valueOf(13));
        fiboArr.add(BigInteger.valueOf(21));
        fiboArr.add(BigInteger.valueOf(34));

        BigInteger answer = BigInteger.valueOf(1);
        BigInteger aaa = BigInteger.valueOf(1000000007);
        for (int i = 0; i < m + 1; i++) {
            answer = answer.multiply(fibo(fiboArr, renzoku[i]));
            answer = answer.mod(aaa);
        }

        System.out.println(answer.longValue());
    } Scanner s = new Scanner(System.in); s new Scanner(System.in) int n = s.nextInt(); n s.nextInt() s.nextInt s int m = s.nextInt(); m s.nextInt() s.nextInt s int[] arr = new int[m]; arr new int[m] m int prev1 = -1; prev1 -1 1 for (int i = 0; i < m; i++) {
            int broken = s.nextInt();
            if (broken == prev1 + 1) {
                System.out.println(0);
                return;
            }
            arr[i] = prev1 = broken;
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            int broken = s.nextInt();
            if (broken == prev1 + 1) {
                System.out.println(0);
                return;
            }
            arr[i] = prev1 = broken;
        } {
            int broken = s.nextInt();
            if (broken == prev1 + 1) {
                System.out.println(0);
                return;
            }
            arr[i] = prev1 = broken;
        } int broken = s.nextInt(); broken s.nextInt() s.nextInt s if (broken == prev1 + 1) {
                System.out.println(0);
                return;
            } broken == prev1 + 1 broken prev1 + 1 prev1 1 {
                System.out.println(0);
                return;
            } System.out.println(0) System.out.println System.out System System.out 0 return; arr[i] = prev1 = broken arr[i] arr i prev1 = broken prev1 broken if (arr.length == 0) {
            ArrayList<BigInteger> fiboArr = new ArrayList<>(n * 2);
            fiboArr.add(BigInteger.valueOf(1));
            fiboArr.add(BigInteger.valueOf(1));
            fiboArr.add(BigInteger.valueOf(2));
            fiboArr.add(BigInteger.valueOf(3));
            fiboArr.add(BigInteger.valueOf(5));
            fiboArr.add(BigInteger.valueOf(8));
            fiboArr.add(BigInteger.valueOf(13));
            fiboArr.add(BigInteger.valueOf(21));
            fiboArr.add(BigInteger.valueOf(34));

            BigInteger aaa = BigInteger.valueOf(1000000007);
            BigInteger answer = fibo(fiboArr, n + 1);
            answer = answer.mod(aaa);

            System.out.println(answer.longValue());
            return;
        } arr.length == 0 arr.length arr arr.length 0 {
            ArrayList<BigInteger> fiboArr = new ArrayList<>(n * 2);
            fiboArr.add(BigInteger.valueOf(1));
            fiboArr.add(BigInteger.valueOf(1));
            fiboArr.add(BigInteger.valueOf(2));
            fiboArr.add(BigInteger.valueOf(3));
            fiboArr.add(BigInteger.valueOf(5));
            fiboArr.add(BigInteger.valueOf(8));
            fiboArr.add(BigInteger.valueOf(13));
            fiboArr.add(BigInteger.valueOf(21));
            fiboArr.add(BigInteger.valueOf(34));

            BigInteger aaa = BigInteger.valueOf(1000000007);
            BigInteger answer = fibo(fiboArr, n + 1);
            answer = answer.mod(aaa);

            System.out.println(answer.longValue());
            return;
        } ArrayList<BigInteger> fiboArr = new ArrayList<>(n * 2); fiboArr new ArrayList<>(n * 2) fiboArr.add(BigInteger.valueOf(1)) fiboArr.add fiboArr BigInteger.valueOf(1) BigInteger.valueOf BigInteger 1 fiboArr.add(BigInteger.valueOf(1)) fiboArr.add fiboArr BigInteger.valueOf(1) BigInteger.valueOf BigInteger 1 fiboArr.add(BigInteger.valueOf(2)) fiboArr.add fiboArr BigInteger.valueOf(2) BigInteger.valueOf BigInteger 2 fiboArr.add(BigInteger.valueOf(3)) fiboArr.add fiboArr BigInteger.valueOf(3) BigInteger.valueOf BigInteger 3 fiboArr.add(BigInteger.valueOf(5)) fiboArr.add fiboArr BigInteger.valueOf(5) BigInteger.valueOf BigInteger 5 fiboArr.add(BigInteger.valueOf(8)) fiboArr.add fiboArr BigInteger.valueOf(8) BigInteger.valueOf BigInteger 8 fiboArr.add(BigInteger.valueOf(13)) fiboArr.add fiboArr BigInteger.valueOf(13) BigInteger.valueOf BigInteger 13 fiboArr.add(BigInteger.valueOf(21)) fiboArr.add fiboArr BigInteger.valueOf(21) BigInteger.valueOf BigInteger 21 fiboArr.add(BigInteger.valueOf(34)) fiboArr.add fiboArr BigInteger.valueOf(34) BigInteger.valueOf BigInteger 34 BigInteger aaa = BigInteger.valueOf(1000000007); aaa BigInteger.valueOf(1000000007) BigInteger.valueOf BigInteger 1000000007 BigInteger answer = fibo(fiboArr, n + 1); answer fibo(fiboArr, n + 1) fibo fiboArr n + 1 n 1 answer = answer.mod(aaa) answer answer.mod(aaa) answer.mod answer aaa System.out.println(answer.longValue()) System.out.println System.out System System.out answer.longValue() answer.longValue answer return; int prev2; prev2 int[] renzoku = new int[m + 1]; renzoku new int[m + 1] m + 1 m 1 renzoku[0] = arr[0] renzoku[0] renzoku 0 arr[0] arr 0 int maxRen = arr[0]; maxRen arr[0] arr 0 prev2 = arr[0] prev2 arr[0] arr 0 for (int i = 1; i < m; i++) {
            int next = arr[i];
            renzoku[i] = next - prev2 - 1;
            maxRen = Math.max(maxRen, renzoku[i]);
            prev2 = next;
        } int i = 1; int i = 1; i 1 i < m i m i++ i++ i {
            int next = arr[i];
            renzoku[i] = next - prev2 - 1;
            maxRen = Math.max(maxRen, renzoku[i]);
            prev2 = next;
        } {
            int next = arr[i];
            renzoku[i] = next - prev2 - 1;
            maxRen = Math.max(maxRen, renzoku[i]);
            prev2 = next;
        } int next = arr[i]; next arr[i] arr i renzoku[i] = next - prev2 - 1 renzoku[i] renzoku i next - prev2 - 1 next - prev2 - 1 next prev2 1 maxRen = Math.max(maxRen, renzoku[i]) maxRen Math.max(maxRen, renzoku[i]) Math.max Math maxRen renzoku[i] renzoku i prev2 = next prev2 next renzoku[m] = n - prev2 renzoku[m] renzoku m n - prev2 n prev2 maxRen = Math.max(maxRen, renzoku[m]) maxRen Math.max(maxRen, renzoku[m]) Math.max Math maxRen renzoku[m] renzoku m ArrayList<BigInteger> fiboArr = new ArrayList<>(maxRen * 2); fiboArr new ArrayList<>(maxRen * 2) fiboArr.add(BigInteger.valueOf(1)) fiboArr.add fiboArr BigInteger.valueOf(1) BigInteger.valueOf BigInteger 1 fiboArr.add(BigInteger.valueOf(1)) fiboArr.add fiboArr BigInteger.valueOf(1) BigInteger.valueOf BigInteger 1 fiboArr.add(BigInteger.valueOf(2)) fiboArr.add fiboArr BigInteger.valueOf(2) BigInteger.valueOf BigInteger 2 fiboArr.add(BigInteger.valueOf(3)) fiboArr.add fiboArr BigInteger.valueOf(3) BigInteger.valueOf BigInteger 3 fiboArr.add(BigInteger.valueOf(5)) fiboArr.add fiboArr BigInteger.valueOf(5) BigInteger.valueOf BigInteger 5 fiboArr.add(BigInteger.valueOf(8)) fiboArr.add fiboArr BigInteger.valueOf(8) BigInteger.valueOf BigInteger 8 fiboArr.add(BigInteger.valueOf(13)) fiboArr.add fiboArr BigInteger.valueOf(13) BigInteger.valueOf BigInteger 13 fiboArr.add(BigInteger.valueOf(21)) fiboArr.add fiboArr BigInteger.valueOf(21) BigInteger.valueOf BigInteger 21 fiboArr.add(BigInteger.valueOf(34)) fiboArr.add fiboArr BigInteger.valueOf(34) BigInteger.valueOf BigInteger 34 BigInteger answer = BigInteger.valueOf(1); answer BigInteger.valueOf(1) BigInteger.valueOf BigInteger 1 BigInteger aaa = BigInteger.valueOf(1000000007); aaa BigInteger.valueOf(1000000007) BigInteger.valueOf BigInteger 1000000007 for (int i = 0; i < m + 1; i++) {
            answer = answer.multiply(fibo(fiboArr, renzoku[i]));
            answer = answer.mod(aaa);
        } int i = 0; int i = 0; i 0 i < m + 1 i m + 1 m 1 i++ i++ i {
            answer = answer.multiply(fibo(fiboArr, renzoku[i]));
            answer = answer.mod(aaa);
        } {
            answer = answer.multiply(fibo(fiboArr, renzoku[i]));
            answer = answer.mod(aaa);
        } answer = answer.multiply(fibo(fiboArr, renzoku[i])) answer answer.multiply(fibo(fiboArr, renzoku[i])) answer.multiply answer fibo(fiboArr, renzoku[i]) fibo fiboArr renzoku[i] renzoku i answer = answer.mod(aaa) answer answer.mod(aaa) answer.mod answer aaa System.out.println(answer.longValue()) System.out.println System.out System System.out answer.longValue() answer.longValue answer String[] args args private static BigInteger fibo(ArrayList<BigInteger> temp, int _i) {
        int i = _i - 1;
        if (temp.size() > i) {
            return temp.get(i);
        }
        int last = temp.size();

        for (int i1 = last; i1 <= i; i1++) {
            temp.add(temp.get(i1 - 2).add(temp.get(i1 - 1)));
        }
        return temp.get(i);
    } fibo {
        int i = _i - 1;
        if (temp.size() > i) {
            return temp.get(i);
        }
        int last = temp.size();

        for (int i1 = last; i1 <= i; i1++) {
            temp.add(temp.get(i1 - 2).add(temp.get(i1 - 1)));
        }
        return temp.get(i);
    } int i = _i - 1; i _i - 1 _i 1 if (temp.size() > i) {
            return temp.get(i);
        } temp.size() > i temp.size() temp.size temp i {
            return temp.get(i);
        } return temp.get(i); temp.get(i) temp.get temp i int last = temp.size(); last temp.size() temp.size temp for (int i1 = last; i1 <= i; i1++) {
            temp.add(temp.get(i1 - 2).add(temp.get(i1 - 1)));
        } int i1 = last; int i1 = last; i1 last i1 <= i i1 i i1++ i1++ i1 {
            temp.add(temp.get(i1 - 2).add(temp.get(i1 - 1)));
        } {
            temp.add(temp.get(i1 - 2).add(temp.get(i1 - 1)));
        } temp.add(temp.get(i1 - 2).add(temp.get(i1 - 1))) temp.add temp temp.get(i1 - 2).add(temp.get(i1 - 1)) temp.get(i1 - 2).add temp.get(i1 - 2) temp.get temp i1 - 2 i1 2 temp.get(i1 - 1) temp.get temp i1 - 1 i1 1 return temp.get(i); temp.get(i) temp.get temp i ArrayList<BigInteger> temp temp int _i _i public class Main {
    public static void main(String[] args) throws FileNotFoundException {
        Scanner s = new Scanner(System.in);

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

        int[] arr = new int[m];
        int prev1 = -1;
        for (int i = 0; i < m; i++) {
            int broken = s.nextInt();
            if (broken == prev1 + 1) {
                System.out.println(0);
                return;
            }
            arr[i] = prev1 = broken;
        }
        if (arr.length == 0) {
            ArrayList<BigInteger> fiboArr = new ArrayList<>(n * 2);
            fiboArr.add(BigInteger.valueOf(1));
            fiboArr.add(BigInteger.valueOf(1));
            fiboArr.add(BigInteger.valueOf(2));
            fiboArr.add(BigInteger.valueOf(3));
            fiboArr.add(BigInteger.valueOf(5));
            fiboArr.add(BigInteger.valueOf(8));
            fiboArr.add(BigInteger.valueOf(13));
            fiboArr.add(BigInteger.valueOf(21));
            fiboArr.add(BigInteger.valueOf(34));

            BigInteger aaa = BigInteger.valueOf(1000000007);
            BigInteger answer = fibo(fiboArr, n + 1);
            answer = answer.mod(aaa);

            System.out.println(answer.longValue());
            return;
        }

        int prev2;
        int[] renzoku = new int[m + 1];
        renzoku[0] = arr[0];
        int maxRen = arr[0];
        prev2 = arr[0];
        for (int i = 1; i < m; i++) {
            int next = arr[i];
            renzoku[i] = next - prev2 - 1;
            maxRen = Math.max(maxRen, renzoku[i]);
            prev2 = next;
        }
        renzoku[m] = n - prev2;
        maxRen = Math.max(maxRen, renzoku[m]);

        // 1: 1
        // 2: 1
        // 3: 2
        // 4: 3
        // 5: 5
        // 6: 8

        ArrayList<BigInteger> fiboArr = new ArrayList<>(maxRen * 2);
        fiboArr.add(BigInteger.valueOf(1));
        fiboArr.add(BigInteger.valueOf(1));
        fiboArr.add(BigInteger.valueOf(2));
        fiboArr.add(BigInteger.valueOf(3));
        fiboArr.add(BigInteger.valueOf(5));
        fiboArr.add(BigInteger.valueOf(8));
        fiboArr.add(BigInteger.valueOf(13));
        fiboArr.add(BigInteger.valueOf(21));
        fiboArr.add(BigInteger.valueOf(34));

        BigInteger answer = BigInteger.valueOf(1);
        BigInteger aaa = BigInteger.valueOf(1000000007);
        for (int i = 0; i < m + 1; i++) {
            answer = answer.multiply(fibo(fiboArr, renzoku[i]));
            answer = answer.mod(aaa);
        }

        System.out.println(answer.longValue());
    }

    private static BigInteger fibo(ArrayList<BigInteger> temp, int _i) {
        int i = _i - 1;
        if (temp.size() > i) {
            return temp.get(i);
        }
        int last = temp.size();

        for (int i1 = last; i1 <= i; i1++) {
            temp.add(temp.get(i1 - 2).add(temp.get(i1 - 1)));
        }
        return temp.get(i);
    }
} public class Main {
    public static void main(String[] args) throws FileNotFoundException {
        Scanner s = new Scanner(System.in);

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

        int[] arr = new int[m];
        int prev1 = -1;
        for (int i = 0; i < m; i++) {
            int broken = s.nextInt();
            if (broken == prev1 + 1) {
                System.out.println(0);
                return;
            }
            arr[i] = prev1 = broken;
        }
        if (arr.length == 0) {
            ArrayList<BigInteger> fiboArr = new ArrayList<>(n * 2);
            fiboArr.add(BigInteger.valueOf(1));
            fiboArr.add(BigInteger.valueOf(1));
            fiboArr.add(BigInteger.valueOf(2));
            fiboArr.add(BigInteger.valueOf(3));
            fiboArr.add(BigInteger.valueOf(5));
            fiboArr.add(BigInteger.valueOf(8));
            fiboArr.add(BigInteger.valueOf(13));
            fiboArr.add(BigInteger.valueOf(21));
            fiboArr.add(BigInteger.valueOf(34));

            BigInteger aaa = BigInteger.valueOf(1000000007);
            BigInteger answer = fibo(fiboArr, n + 1);
            answer = answer.mod(aaa);

            System.out.println(answer.longValue());
            return;
        }

        int prev2;
        int[] renzoku = new int[m + 1];
        renzoku[0] = arr[0];
        int maxRen = arr[0];
        prev2 = arr[0];
        for (int i = 1; i < m; i++) {
            int next = arr[i];
            renzoku[i] = next - prev2 - 1;
            maxRen = Math.max(maxRen, renzoku[i]);
            prev2 = next;
        }
        renzoku[m] = n - prev2;
        maxRen = Math.max(maxRen, renzoku[m]);

        // 1: 1
        // 2: 1
        // 3: 2
        // 4: 3
        // 5: 5
        // 6: 8

        ArrayList<BigInteger> fiboArr = new ArrayList<>(maxRen * 2);
        fiboArr.add(BigInteger.valueOf(1));
        fiboArr.add(BigInteger.valueOf(1));
        fiboArr.add(BigInteger.valueOf(2));
        fiboArr.add(BigInteger.valueOf(3));
        fiboArr.add(BigInteger.valueOf(5));
        fiboArr.add(BigInteger.valueOf(8));
        fiboArr.add(BigInteger.valueOf(13));
        fiboArr.add(BigInteger.valueOf(21));
        fiboArr.add(BigInteger.valueOf(34));

        BigInteger answer = BigInteger.valueOf(1);
        BigInteger aaa = BigInteger.valueOf(1000000007);
        for (int i = 0; i < m + 1; i++) {
            answer = answer.multiply(fibo(fiboArr, renzoku[i]));
            answer = answer.mod(aaa);
        }

        System.out.println(answer.longValue());
    }

    private static BigInteger fibo(ArrayList<BigInteger> temp, int _i) {
        int i = _i - 1;
        if (temp.size() > i) {
            return temp.get(i);
        }
        int last = temp.size();

        for (int i1 = last; i1 <= i; i1++) {
            temp.add(temp.get(i1 - 2).add(temp.get(i1 - 1)));
        }
        return temp.get(i);
    }
} Main
import java.io.File;
import java.io.FileNotFoundException;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws FileNotFoundException {
        Scanner s = new Scanner(System.in);

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

        int[] arr = new int[m];
        int prev1 = -1;
        for (int i = 0; i < m; i++) {
            int broken = s.nextInt();
            if (broken == prev1 + 1) {
                System.out.println(0);
                return;
            }
            arr[i] = prev1 = broken;
        }
        if (arr.length == 0) {
            ArrayList<BigInteger> fiboArr = new ArrayList<>(n * 2);
            fiboArr.add(BigInteger.valueOf(1));
            fiboArr.add(BigInteger.valueOf(1));
            fiboArr.add(BigInteger.valueOf(2));
            fiboArr.add(BigInteger.valueOf(3));
            fiboArr.add(BigInteger.valueOf(5));
            fiboArr.add(BigInteger.valueOf(8));
            fiboArr.add(BigInteger.valueOf(13));
            fiboArr.add(BigInteger.valueOf(21));
            fiboArr.add(BigInteger.valueOf(34));

            BigInteger aaa = BigInteger.valueOf(1000000007);
            BigInteger answer = fibo(fiboArr, n + 1);
            answer = answer.mod(aaa);

            System.out.println(answer.longValue());
            return;
        }

        int prev2;
        int[] renzoku = new int[m + 1];
        renzoku[0] = arr[0];
        int maxRen = arr[0];
        prev2 = arr[0];
        for (int i = 1; i < m; i++) {
            int next = arr[i];
            renzoku[i] = next - prev2 - 1;
            maxRen = Math.max(maxRen, renzoku[i]);
            prev2 = next;
        }
        renzoku[m] = n - prev2;
        maxRen = Math.max(maxRen, renzoku[m]);

        // 1: 1
        // 2: 1
        // 3: 2
        // 4: 3
        // 5: 5
        // 6: 8

        ArrayList<BigInteger> fiboArr = new ArrayList<>(maxRen * 2);
        fiboArr.add(BigInteger.valueOf(1));
        fiboArr.add(BigInteger.valueOf(1));
        fiboArr.add(BigInteger.valueOf(2));
        fiboArr.add(BigInteger.valueOf(3));
        fiboArr.add(BigInteger.valueOf(5));
        fiboArr.add(BigInteger.valueOf(8));
        fiboArr.add(BigInteger.valueOf(13));
        fiboArr.add(BigInteger.valueOf(21));
        fiboArr.add(BigInteger.valueOf(34));

        BigInteger answer = BigInteger.valueOf(1);
        BigInteger aaa = BigInteger.valueOf(1000000007);
        for (int i = 0; i < m + 1; i++) {
            answer = answer.multiply(fibo(fiboArr, renzoku[i]));
            answer = answer.mod(aaa);
        }

        System.out.println(answer.longValue());
    }

    private static BigInteger fibo(ArrayList<BigInteger> temp, int _i) {
        int i = _i - 1;
        if (temp.size() > i) {
            return temp.get(i);
        }
        int last = temp.size();

        for (int i1 = last; i1 <= i; i1++) {
            temp.add(temp.get(i1 - 2).add(temp.get(i1 - 1)));
        }
        return temp.get(i);
    }
}
