n,a=$<.map{|m|m.split.map(&:to_i)}

lgcd = [0]
rgcd = [0]
size = n[0]
size.times do |i|
  l = i
  r = -i-1
  lgcd << a[l].gcd(lgcd.last)
  rgcd << a[r].gcd(rgcd.last)
end

p size.times.map {|i| lgcd[i].gcd(rgcd[size-i-1]) }.max
