object Main extends App {
  import scala.io.StdIn.readLine

  val input = readLine().split(" ").map(_.toInt)
  val N = input(0)
  val X = input(1)

  val xStr = readLine()
  val xArray = (X + " " + xStr).split(" ").map(_.toInt).sorted

  var min = 10000000000L
  var max = 1L
  for (i <- 0 to N - 1) {
    val diff = xArray(i + 1) - xArray(i)
    if (min > diff) min = diff
    if (max < diff) max = diff
  }

  if (max % min == 0) {
    print(min)
  } else {
    print(1)
  }
}