(define (list-init n func)
  (let loop ([i n])
    (if (zero? i)
      ()
      (cons (func) (loop (- i 1))))))

(define (vector-init n func)
  (define vec (make-vector n))
  (dotimes (i n)
    (vector-set! vec i (func)))
  vec)

(define (collection-init collection size func)
  (cond [(eq? collection <vector>) (vector-init size func)]
        [(eq? collection <list>) (list-init size func)]
        [else "Error"]))

(define-syntax input!
  (syntax-rules (as)
    ((_ (p))
      (define p (input-inner)))
    ((_ (p [as expr-x size-x] [as expr-y size-y]))
      (define p (input-inner [as expr-x size-x] [as expr-y size-y])))
    ((_ (p [as expr size]))
      (define p (input-inner [as expr size])))
    ((_ (p1 ...) (p2 ...) ...)
      (begin 
        (input! (p1 ...))
        (input! (p2 ...) ...)))))

(define-syntax input-inner
  (syntax-rules (as)
    ((_)
     (read))
    ((_ [as expr-x size-x] [as expr-y size-y])
      (collection-init expr-y size-y (lambda () (input-inner [as expr-x size-x]))))
    ((_ [as expr size])
      (collection-init expr size read))))

(define vr vector-ref)
(define vset! vector-set!)
; -----------------------------------------------

(input! (n)
        (m)
        (a [as <list> m]))

(define mod 1000000007)
(define broken-table 
  (let ([table (make-vector (+ n 1) #f)])
   (for-each (lambda (x) (vset! table x #t)) a)
   table))

(define (broken x)
  (vr broken-table x))

(define dp (make-vector (+ n 1) -1))

(print
  (let loop ([i n])
    (cond [(broken i) 0]
          [(= i 0) 1]
          [(= i 1) 1]
          [(< -1 (vr dp i)) (vr dp i)]
          [else (begin 
                  (vset! dp i (remainder (+ (loop (- i 1)) (loop (- i 2))) mod))
                  (vr dp i))])))
