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();
        int[] a = new int[m];
        for (int i = 0 ; i < m ; i++) {
            a[i] = sc.nextInt();
        }
        int mod = 1000000007;
        long[] sum = new long[n + 2];
        sum[1] = 1;
        for (int i = 2 ; i < n + 2 ; i++) {
            sum[i] =   (long) sum[i - 1] + sum[i - 2];
            sum[i] %= mod;
        }
        if (m == 0) {
            System.out.println(sum[n + 1]);
            return;
        }
        for (int i = 0 ; i < m - 1 ; i++) {
            if (a[i + 1] - a[i] == 1) {
                System.out.println(0);
                return;
            }
        }
        long ans = 1l;
        int [] b = new int[m + 1];

        if (m == 1) {
            b[0] = a[0];
            b[1] = n - a[0];
        } else {
            b[0] = a[0];
            b[m] = n - a[m - 1];
            for (int i = 1 ; i < m ; i++) {
                if (a[i] - a[i - 1] == 0) {
                    b[i] = 1;
                } else {
                    b[i] = a[i] - a[i - 1] - 1;
                }
            }
        }
        for (int i = 0 ; i < m + 1 ; i++) {
            ans *= sum[b[i]] % mod;
            ans %= mod;
        }
        System.out.println(ans % mod);
    }

} 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();
        int[] a = new int[m];
        for (int i = 0 ; i < m ; i++) {
            a[i] = sc.nextInt();
        }
        int mod = 1000000007;
        long[] sum = new long[n + 2];
        sum[1] = 1;
        for (int i = 2 ; i < n + 2 ; i++) {
            sum[i] =   (long) sum[i - 1] + sum[i - 2];
            sum[i] %= mod;
        }
        if (m == 0) {
            System.out.println(sum[n + 1]);
            return;
        }
        for (int i = 0 ; i < m - 1 ; i++) {
            if (a[i + 1] - a[i] == 1) {
                System.out.println(0);
                return;
            }
        }
        long ans = 1l;
        int [] b = new int[m + 1];

        if (m == 1) {
            b[0] = a[0];
            b[1] = n - a[0];
        } else {
            b[0] = a[0];
            b[m] = n - a[m - 1];
            for (int i = 1 ; i < m ; i++) {
                if (a[i] - a[i - 1] == 0) {
                    b[i] = 1;
                } else {
                    b[i] = a[i] - a[i - 1] - 1;
                }
            }
        }
        for (int i = 0 ; i < m + 1 ; i++) {
            ans *= sum[b[i]] % mod;
            ans %= mod;
        }
        System.out.println(ans % mod);
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] a = new int[m];
        for (int i = 0 ; i < m ; i++) {
            a[i] = sc.nextInt();
        }
        int mod = 1000000007;
        long[] sum = new long[n + 2];
        sum[1] = 1;
        for (int i = 2 ; i < n + 2 ; i++) {
            sum[i] =   (long) sum[i - 1] + sum[i - 2];
            sum[i] %= mod;
        }
        if (m == 0) {
            System.out.println(sum[n + 1]);
            return;
        }
        for (int i = 0 ; i < m - 1 ; i++) {
            if (a[i + 1] - a[i] == 1) {
                System.out.println(0);
                return;
            }
        }
        long ans = 1l;
        int [] b = new int[m + 1];

        if (m == 1) {
            b[0] = a[0];
            b[1] = n - a[0];
        } else {
            b[0] = a[0];
            b[m] = n - a[m - 1];
            for (int i = 1 ; i < m ; i++) {
                if (a[i] - a[i - 1] == 0) {
                    b[i] = 1;
                } else {
                    b[i] = a[i] - a[i - 1] - 1;
                }
            }
        }
        for (int i = 0 ; i < m + 1 ; i++) {
            ans *= sum[b[i]] % mod;
            ans %= mod;
        }
        System.out.println(ans % mod);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] a = new int[m];
        for (int i = 0 ; i < m ; i++) {
            a[i] = sc.nextInt();
        }
        int mod = 1000000007;
        long[] sum = new long[n + 2];
        sum[1] = 1;
        for (int i = 2 ; i < n + 2 ; i++) {
            sum[i] =   (long) sum[i - 1] + sum[i - 2];
            sum[i] %= mod;
        }
        if (m == 0) {
            System.out.println(sum[n + 1]);
            return;
        }
        for (int i = 0 ; i < m - 1 ; i++) {
            if (a[i + 1] - a[i] == 1) {
                System.out.println(0);
                return;
            }
        }
        long ans = 1l;
        int [] b = new int[m + 1];

        if (m == 1) {
            b[0] = a[0];
            b[1] = n - a[0];
        } else {
            b[0] = a[0];
            b[m] = n - a[m - 1];
            for (int i = 1 ; i < m ; i++) {
                if (a[i] - a[i - 1] == 0) {
                    b[i] = 1;
                } else {
                    b[i] = a[i] - a[i - 1] - 1;
                }
            }
        }
        for (int i = 0 ; i < m + 1 ; i++) {
            ans *= sum[b[i]] % mod;
            ans %= mod;
        }
        System.out.println(ans % mod);
    } 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[] a = new int[m]; a new int[m] m for (int i = 0 ; i < m ; i++) {
            a[i] = sc.nextInt();
        } int i = 0 ; int i = 0 ; i 0 i < m i m i++ i++ i {
            a[i] = sc.nextInt();
        } {
            a[i] = sc.nextInt();
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc int mod = 1000000007; mod 1000000007 long[] sum = new long[n + 2]; sum new long[n + 2] n + 2 n 2 sum[1] = 1 sum[1] sum 1 1 for (int i = 2 ; i < n + 2 ; i++) {
            sum[i] =   (long) sum[i - 1] + sum[i - 2];
            sum[i] %= mod;
        } int i = 2 ; int i = 2 ; i 2 i < n + 2 i n + 2 n 2 i++ i++ i {
            sum[i] =   (long) sum[i - 1] + sum[i - 2];
            sum[i] %= mod;
        } {
            sum[i] =   (long) sum[i - 1] + sum[i - 2];
            sum[i] %= mod;
        } sum[i] =   (long) sum[i - 1] + sum[i - 2] sum[i] sum i (long) sum[i - 1] + sum[i - 2] (long) sum[i - 1] sum i - 1 i 1 sum[i - 2] sum i - 2 i 2 sum[i] %= mod sum[i] sum i mod if (m == 0) {
            System.out.println(sum[n + 1]);
            return;
        } m == 0 m 0 {
            System.out.println(sum[n + 1]);
            return;
        } System.out.println(sum[n + 1]) System.out.println System.out System System.out sum[n + 1] sum n + 1 n 1 return; for (int i = 0 ; i < m - 1 ; i++) {
            if (a[i + 1] - a[i] == 1) {
                System.out.println(0);
                return;
            }
        } int i = 0 ; int i = 0 ; i 0 i < m - 1 i m - 1 m 1 i++ i++ i {
            if (a[i + 1] - a[i] == 1) {
                System.out.println(0);
                return;
            }
        } {
            if (a[i + 1] - a[i] == 1) {
                System.out.println(0);
                return;
            }
        } if (a[i + 1] - a[i] == 1) {
                System.out.println(0);
                return;
            } a[i + 1] - a[i] == 1 a[i + 1] - a[i] a[i + 1] a i + 1 i 1 a[i] a i 1 {
                System.out.println(0);
                return;
            } System.out.println(0) System.out.println System.out System System.out 0 return; long ans = 1l; ans 1l int [] b = new int[m + 1]; b new int[m + 1] m + 1 m 1 if (m == 1) {
            b[0] = a[0];
            b[1] = n - a[0];
        } else {
            b[0] = a[0];
            b[m] = n - a[m - 1];
            for (int i = 1 ; i < m ; i++) {
                if (a[i] - a[i - 1] == 0) {
                    b[i] = 1;
                } else {
                    b[i] = a[i] - a[i - 1] - 1;
                }
            }
        } m == 1 m 1 {
            b[0] = a[0];
            b[1] = n - a[0];
        } b[0] = a[0] b[0] b 0 a[0] a 0 b[1] = n - a[0] b[1] b 1 n - a[0] n a[0] a 0 {
            b[0] = a[0];
            b[m] = n - a[m - 1];
            for (int i = 1 ; i < m ; i++) {
                if (a[i] - a[i - 1] == 0) {
                    b[i] = 1;
                } else {
                    b[i] = a[i] - a[i - 1] - 1;
                }
            }
        } b[0] = a[0] b[0] b 0 a[0] a 0 b[m] = n - a[m - 1] b[m] b m n - a[m - 1] n a[m - 1] a m - 1 m 1 for (int i = 1 ; i < m ; i++) {
                if (a[i] - a[i - 1] == 0) {
                    b[i] = 1;
                } else {
                    b[i] = a[i] - a[i - 1] - 1;
                }
            } int i = 1 ; int i = 1 ; i 1 i < m i m i++ i++ i {
                if (a[i] - a[i - 1] == 0) {
                    b[i] = 1;
                } else {
                    b[i] = a[i] - a[i - 1] - 1;
                }
            } {
                if (a[i] - a[i - 1] == 0) {
                    b[i] = 1;
                } else {
                    b[i] = a[i] - a[i - 1] - 1;
                }
            } if (a[i] - a[i - 1] == 0) {
                    b[i] = 1;
                } else {
                    b[i] = a[i] - a[i - 1] - 1;
                } a[i] - a[i - 1] == 0 a[i] - a[i - 1] a[i] a i a[i - 1] a i - 1 i 1 0 {
                    b[i] = 1;
                } b[i] = 1 b[i] b i 1 {
                    b[i] = a[i] - a[i - 1] - 1;
                } b[i] = a[i] - a[i - 1] - 1 b[i] b i a[i] - a[i - 1] - 1 a[i] - a[i - 1] - 1 a[i] a i a[i - 1] a i - 1 i 1 1 for (int i = 0 ; i < m + 1 ; i++) {
            ans *= sum[b[i]] % mod;
            ans %= mod;
        } int i = 0 ; int i = 0 ; i 0 i < m + 1 i m + 1 m 1 i++ i++ i {
            ans *= sum[b[i]] % mod;
            ans %= mod;
        } {
            ans *= sum[b[i]] % mod;
            ans %= mod;
        } ans *= sum[b[i]] % mod ans sum[b[i]] % mod sum[b[i]] sum b[i] b i mod ans %= mod ans mod System.out.println(ans % mod) System.out.println System.out System System.out ans % mod ans mod 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[] a = new int[m];
        for (int i = 0 ; i < m ; i++) {
            a[i] = sc.nextInt();
        }
        int mod = 1000000007;
        long[] sum = new long[n + 2];
        sum[1] = 1;
        for (int i = 2 ; i < n + 2 ; i++) {
            sum[i] =   (long) sum[i - 1] + sum[i - 2];
            sum[i] %= mod;
        }
        if (m == 0) {
            System.out.println(sum[n + 1]);
            return;
        }
        for (int i = 0 ; i < m - 1 ; i++) {
            if (a[i + 1] - a[i] == 1) {
                System.out.println(0);
                return;
            }
        }
        long ans = 1l;
        int [] b = new int[m + 1];

        if (m == 1) {
            b[0] = a[0];
            b[1] = n - a[0];
        } else {
            b[0] = a[0];
            b[m] = n - a[m - 1];
            for (int i = 1 ; i < m ; i++) {
                if (a[i] - a[i - 1] == 0) {
                    b[i] = 1;
                } else {
                    b[i] = a[i] - a[i - 1] - 1;
                }
            }
        }
        for (int i = 0 ; i < m + 1 ; i++) {
            ans *= sum[b[i]] % mod;
            ans %= mod;
        }
        System.out.println(ans % mod);
    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] a = new int[m];
        for (int i = 0 ; i < m ; i++) {
            a[i] = sc.nextInt();
        }
        int mod = 1000000007;
        long[] sum = new long[n + 2];
        sum[1] = 1;
        for (int i = 2 ; i < n + 2 ; i++) {
            sum[i] =   (long) sum[i - 1] + sum[i - 2];
            sum[i] %= mod;
        }
        if (m == 0) {
            System.out.println(sum[n + 1]);
            return;
        }
        for (int i = 0 ; i < m - 1 ; i++) {
            if (a[i + 1] - a[i] == 1) {
                System.out.println(0);
                return;
            }
        }
        long ans = 1l;
        int [] b = new int[m + 1];

        if (m == 1) {
            b[0] = a[0];
            b[1] = n - a[0];
        } else {
            b[0] = a[0];
            b[m] = n - a[m - 1];
            for (int i = 1 ; i < m ; i++) {
                if (a[i] - a[i - 1] == 0) {
                    b[i] = 1;
                } else {
                    b[i] = a[i] - a[i - 1] - 1;
                }
            }
        }
        for (int i = 0 ; i < m + 1 ; i++) {
            ans *= sum[b[i]] % mod;
            ans %= mod;
        }
        System.out.println(ans % mod);
    }

} 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();
        int[] a = new int[m];
        for (int i = 0 ; i < m ; i++) {
            a[i] = sc.nextInt();
        }
        int mod = 1000000007;
        long[] sum = new long[n + 2];
        sum[1] = 1;
        for (int i = 2 ; i < n + 2 ; i++) {
            sum[i] =   (long) sum[i - 1] + sum[i - 2];
            sum[i] %= mod;
        }
        if (m == 0) {
            System.out.println(sum[n + 1]);
            return;
        }
        for (int i = 0 ; i < m - 1 ; i++) {
            if (a[i + 1] - a[i] == 1) {
                System.out.println(0);
                return;
            }
        }
        long ans = 1l;
        int [] b = new int[m + 1];

        if (m == 1) {
            b[0] = a[0];
            b[1] = n - a[0];
        } else {
            b[0] = a[0];
            b[m] = n - a[m - 1];
            for (int i = 1 ; i < m ; i++) {
                if (a[i] - a[i - 1] == 0) {
                    b[i] = 1;
                } else {
                    b[i] = a[i] - a[i - 1] - 1;
                }
            }
        }
        for (int i = 0 ; i < m + 1 ; i++) {
            ans *= sum[b[i]] % mod;
            ans %= mod;
        }
        System.out.println(ans % mod);
    }

}
