import Data.List
  
factor x = [y|y<-[x,x-1..1],mod x y == 0]

check [1] _ = 1
check (x:xs) list = if 0 == sum (map (flip mod x) list) then x else check xs list

main = do
 [n,x] <- map read . words <$> getLine :: IO [Int]
 xs <- map read. words <$> getLine
 let list = map (flip(-)(minimum (x:xs))) $ sort (x:xs)
 print $ check (factor (head $ tail list))list
