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 min1 = 10000000000L
  var min2 = 10000000000L
  for (i <- 0 to N - 1) {
    val diff = xArray(i + 1) - xArray(i)
    if (min1 > diff) min1 = diff
    if (i == 0) min2 = diff
    if (diff > min1 && min2 > diff) min2 = diff
  }

  var res = 1L;
  for (i <- 2L to min1) {
    if (min1 % i == 0 && min2 % i == 0) res = i
  }
  print(res)
}