import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CTypicalStairs solver = new CTypicalStairs();
        solver.solve(1, in, out);
        out.close();
    }

    static class CTypicalStairs {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int mod = 1_000_000_007;
            int n = in.nextInt();
            int m = in.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < m; i++)
                arr[i] = in.nextInt();
            //dp[k] : nb of steps to get to get to the N-1th from the kth step
            //dp[k] = if arr[k]==0 => 0 else dp[k+1] + dp[k+2]
            //dp[n-1] = 1
            long[] dp = new long[n + 2];
            dp[n + 1] = 0;
            dp[n] = 1;
            int cur = m == 0 ? -1 : arr[m - 1];
            int indM = m - 1;
            for (int i = n - 1; i >= 0; i--) {
                if (i == cur) {
                    indM--;
                    if (indM >= 0)
                        cur = arr[indM];
                    dp[i] = 0;
                } else {
                    dp[i] = dp[i + 1] + dp[i + 2];
                    dp[i] %= mod;
                }
            }
            out.println(dp[0]);
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CTypicalStairs solver = new CTypicalStairs();
        solver.solve(1, in, out);
        out.close();
    }

    static class CTypicalStairs {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int mod = 1_000_000_007;
            int n = in.nextInt();
            int m = in.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < m; i++)
                arr[i] = in.nextInt();
            //dp[k] : nb of steps to get to get to the N-1th from the kth step
            //dp[k] = if arr[k]==0 => 0 else dp[k+1] + dp[k+2]
            //dp[n-1] = 1
            long[] dp = new long[n + 2];
            dp[n + 1] = 0;
            dp[n] = 1;
            int cur = m == 0 ? -1 : arr[m - 1];
            int indM = m - 1;
            for (int i = n - 1; i >= 0; i--) {
                if (i == cur) {
                    indM--;
                    if (indM >= 0)
                        cur = arr[indM];
                    dp[i] = 0;
                } else {
                    dp[i] = dp[i + 1] + dp[i + 2];
                    dp[i] %= mod;
                }
            }
            out.println(dp[0]);
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CTypicalStairs solver = new CTypicalStairs();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CTypicalStairs solver = new CTypicalStairs();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) CTypicalStairs solver = new CTypicalStairs(); solver new CTypicalStairs() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class CTypicalStairs {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int mod = 1_000_000_007;
            int n = in.nextInt();
            int m = in.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < m; i++)
                arr[i] = in.nextInt();
            //dp[k] : nb of steps to get to get to the N-1th from the kth step
            //dp[k] = if arr[k]==0 => 0 else dp[k+1] + dp[k+2]
            //dp[n-1] = 1
            long[] dp = new long[n + 2];
            dp[n + 1] = 0;
            dp[n] = 1;
            int cur = m == 0 ? -1 : arr[m - 1];
            int indM = m - 1;
            for (int i = n - 1; i >= 0; i--) {
                if (i == cur) {
                    indM--;
                    if (indM >= 0)
                        cur = arr[indM];
                    dp[i] = 0;
                } else {
                    dp[i] = dp[i + 1] + dp[i + 2];
                    dp[i] %= mod;
                }
            }
            out.println(dp[0]);
        }

    } CTypicalStairs public void solve(int testNumber, Scanner in, PrintWriter out) {
            int mod = 1_000_000_007;
            int n = in.nextInt();
            int m = in.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < m; i++)
                arr[i] = in.nextInt();
            //dp[k] : nb of steps to get to get to the N-1th from the kth step
            //dp[k] = if arr[k]==0 => 0 else dp[k+1] + dp[k+2]
            //dp[n-1] = 1
            long[] dp = new long[n + 2];
            dp[n + 1] = 0;
            dp[n] = 1;
            int cur = m == 0 ? -1 : arr[m - 1];
            int indM = m - 1;
            for (int i = n - 1; i >= 0; i--) {
                if (i == cur) {
                    indM--;
                    if (indM >= 0)
                        cur = arr[indM];
                    dp[i] = 0;
                } else {
                    dp[i] = dp[i + 1] + dp[i + 2];
                    dp[i] %= mod;
                }
            }
            out.println(dp[0]);
        } solve {
            int mod = 1_000_000_007;
            int n = in.nextInt();
            int m = in.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < m; i++)
                arr[i] = in.nextInt();
            //dp[k] : nb of steps to get to get to the N-1th from the kth step
            //dp[k] = if arr[k]==0 => 0 else dp[k+1] + dp[k+2]
            //dp[n-1] = 1
            long[] dp = new long[n + 2];
            dp[n + 1] = 0;
            dp[n] = 1;
            int cur = m == 0 ? -1 : arr[m - 1];
            int indM = m - 1;
            for (int i = n - 1; i >= 0; i--) {
                if (i == cur) {
                    indM--;
                    if (indM >= 0)
                        cur = arr[indM];
                    dp[i] = 0;
                } else {
                    dp[i] = dp[i + 1] + dp[i + 2];
                    dp[i] %= mod;
                }
            }
            out.println(dp[0]);
        } int mod = 1_000_000_007; mod 1_000_000_007 int n = in.nextInt(); n in.nextInt() in.nextInt in int m = in.nextInt(); m in.nextInt() in.nextInt in int[] arr = new int[n]; arr new int[n] n for (int i = 0; i < m; i++)
                arr[i] = in.nextInt(); int i = 0; int i = 0; i 0 i < m i m i++ i++ i arr[i] = in.nextInt(); arr[i] = in.nextInt() arr[i] arr i in.nextInt() in.nextInt in long[] dp = new long[n + 2]; dp new long[n + 2] n + 2 n 2 dp[n + 1] = 0 dp[n + 1] dp n + 1 n 1 0 dp[n] = 1 dp[n] dp n 1 int cur = m == 0 ? -1 : arr[m - 1]; cur m == 0 ? -1 : arr[m - 1] m == 0 m 0 -1 1 arr[m - 1] arr m - 1 m 1 int indM = m - 1; indM m - 1 m 1 for (int i = n - 1; i >= 0; i--) {
                if (i == cur) {
                    indM--;
                    if (indM >= 0)
                        cur = arr[indM];
                    dp[i] = 0;
                } else {
                    dp[i] = dp[i + 1] + dp[i + 2];
                    dp[i] %= mod;
                }
            } int i = n - 1; int i = n - 1; i n - 1 n 1 i >= 0 i 0 i-- i-- i {
                if (i == cur) {
                    indM--;
                    if (indM >= 0)
                        cur = arr[indM];
                    dp[i] = 0;
                } else {
                    dp[i] = dp[i + 1] + dp[i + 2];
                    dp[i] %= mod;
                }
            } {
                if (i == cur) {
                    indM--;
                    if (indM >= 0)
                        cur = arr[indM];
                    dp[i] = 0;
                } else {
                    dp[i] = dp[i + 1] + dp[i + 2];
                    dp[i] %= mod;
                }
            } if (i == cur) {
                    indM--;
                    if (indM >= 0)
                        cur = arr[indM];
                    dp[i] = 0;
                } else {
                    dp[i] = dp[i + 1] + dp[i + 2];
                    dp[i] %= mod;
                } i == cur i cur {
                    indM--;
                    if (indM >= 0)
                        cur = arr[indM];
                    dp[i] = 0;
                } indM-- indM if (indM >= 0)
                        cur = arr[indM]; indM >= 0 indM 0 cur = arr[indM] cur arr[indM] arr indM dp[i] = 0 dp[i] dp i 0 {
                    dp[i] = dp[i + 1] + dp[i + 2];
                    dp[i] %= mod;
                } 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] %= mod dp[i] dp i mod out.println(dp[0]) out.println out dp[0] dp 0 int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CTypicalStairs solver = new CTypicalStairs();
        solver.solve(1, in, out);
        out.close();
    }

    static class CTypicalStairs {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int mod = 1_000_000_007;
            int n = in.nextInt();
            int m = in.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < m; i++)
                arr[i] = in.nextInt();
            //dp[k] : nb of steps to get to get to the N-1th from the kth step
            //dp[k] = if arr[k]==0 => 0 else dp[k+1] + dp[k+2]
            //dp[n-1] = 1
            long[] dp = new long[n + 2];
            dp[n + 1] = 0;
            dp[n] = 1;
            int cur = m == 0 ? -1 : arr[m - 1];
            int indM = m - 1;
            for (int i = n - 1; i >= 0; i--) {
                if (i == cur) {
                    indM--;
                    if (indM >= 0)
                        cur = arr[indM];
                    dp[i] = 0;
                } else {
                    dp[i] = dp[i + 1] + dp[i + 2];
                    dp[i] %= mod;
                }
            }
            out.println(dp[0]);
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CTypicalStairs solver = new CTypicalStairs();
        solver.solve(1, in, out);
        out.close();
    }

    static class CTypicalStairs {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int mod = 1_000_000_007;
            int n = in.nextInt();
            int m = in.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < m; i++)
                arr[i] = in.nextInt();
            //dp[k] : nb of steps to get to get to the N-1th from the kth step
            //dp[k] = if arr[k]==0 => 0 else dp[k+1] + dp[k+2]
            //dp[n-1] = 1
            long[] dp = new long[n + 2];
            dp[n + 1] = 0;
            dp[n] = 1;
            int cur = m == 0 ? -1 : arr[m - 1];
            int indM = m - 1;
            for (int i = n - 1; i >= 0; i--) {
                if (i == cur) {
                    indM--;
                    if (indM >= 0)
                        cur = arr[indM];
                    dp[i] = 0;
                } else {
                    dp[i] = dp[i + 1] + dp[i + 2];
                    dp[i] %= mod;
                }
            }
            out.println(dp[0]);
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CTypicalStairs solver = new CTypicalStairs();
        solver.solve(1, in, out);
        out.close();
    }

    static class CTypicalStairs {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int mod = 1_000_000_007;
            int n = in.nextInt();
            int m = in.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < m; i++)
                arr[i] = in.nextInt();
            //dp[k] : nb of steps to get to get to the N-1th from the kth step
            //dp[k] = if arr[k]==0 => 0 else dp[k+1] + dp[k+2]
            //dp[n-1] = 1
            long[] dp = new long[n + 2];
            dp[n + 1] = 0;
            dp[n] = 1;
            int cur = m == 0 ? -1 : arr[m - 1];
            int indM = m - 1;
            for (int i = n - 1; i >= 0; i--) {
                if (i == cur) {
                    indM--;
                    if (indM >= 0)
                        cur = arr[indM];
                    dp[i] = 0;
                } else {
                    dp[i] = dp[i + 1] + dp[i + 2];
                    dp[i] %= mod;
                }
            }
            out.println(dp[0]);
        }

    }
}

