(defn make-vec
  [n]
  (->>
    (clojure.string/split (str n) #" ")
    (map #(Integer/parseInt %))))

(defn abc-125c
  []
  (let [n (Integer/parseInt (read-line))
        a (make-vec (read-line))
        min-a (apply min a)]
    (->>
      (for [i (range 2 (inc min-a))]
        (let [cnt (->> (map #(mod % i) a)
                       (filter pos?)
                       count)]
          (if (> cnt 1) 1 i)))
      (apply max))))


(prn (abc-125c))