'use strict'

const main = (input) => {
    input = input.split('\n')
    const n = parseInt(input[0].split(' ')[0])
    const x = parseInt(input[0].split(' ')[1])
    const arr = input[1].split(' ').map(v => parseInt(v)).sort((a, b) => a - b)
    const dist = arr.reduce((p, v) => Math.min(Math.abs(v - x), p), 100000000000)
    let ans = 1
    for(let i = dist; i >= 1; i--){
        if(arr.every(v => Math.abs(v - x) % i === 0)){
            ans = i
            break
        }
    }
    console.log(ans)
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))