function yakusu(n) {
  var list = []
  for (var i = 1; i < n; i++) {
    if (n % i != 0) continue
    var wari = Math.floor(n / i)
    list.push(wari)
    if (wari <= 1) {
      break
    }
  }
  return list
}

function saikou(list) {
  var hash = {}
  var len = list.length
  for (var i = 0; i < len; i++) {
    yaku_list = yakusu(list[i])

    yaku_list.forEach((yaku) => {
      if (i == 0) {
        if (hash[yaku]) {
          hash[yaku] += 1
        } else {
          hash[yaku] = 1
        }
      } else {
        // 2回目以降
        if (hash[yaku]) {
          hash[yaku] += 1
        } else {
          return
        }
      }
    })

  }
  console.log(hash)

  var common_yakus = []
  Object.keys(hash).forEach(k => {
    if (hash[k] == len) {
      common_yakus.push(Number(k))
    }
  })
  if (common_yakus.length <= 0) {
    return 1
  }
  return Math.max( ...common_yakus )
}


function pr(s) {
  console.log(s)
}




(function(input) {
  'use strict';

  var N = null
  var X = null
  var xs = []
  input.split("\n").some(function(line) {
    if (N == null) {
      var list = line.split(' ')
      N = parseInt(list[0], 10)
      X = parseInt(list[1], 10)
      return false
    } else {
      xs = line.split(' ').map((x) => { return parseInt(x, 10) })
      return true
    }
  })

  // xs.length <= 1の処理
  if (xs.length <= 1) {
    pr(xs[0] - X)
    return
  }

  var abss = []
  xs.forEach((x) => {
    if (x < X) {
      abss.push(X - x)
    } else {
      abss.push(x - X)
    }
  })

  // debug
  // console.log('N')
  // console.log(N)
  // console.log('X')
  // console.log(X)
  // console.log(xs)

  console.log(saikou(abss))
})(require('fs').readFileSync('/dev/stdin', 'utf8'))
