// Original C++ solution (slower):
#include <bits/stdc++.h>

#define rep(i, a, n) for(int (i) = (int)(a);(i) < (int)(n);++(i))

#define repe(i, a, n) for(int (i) = (int)(a);(i) <= (int)(n);++(i))

#define repif(i, a, x) for(int (i) = (int)(a);(x);++(i))

#define repr(i, a, n) for(int (i) = ((int)(a)-1);(i) >= (int)(n);--(i))

#define reper(i, a, n) for(int (i) = (int)(a);(i) >= (int)(n);--(i))

#define chmax(a, b) a = max(a, b)

#define chmin(a, b) a = min(a, b)

#define SIZE(x) ((int)(x).size())

#define ALL(x) (x).begin(), (x).end()

#define RNG(x, a, n) &((x)[a]), &((x)[n])

#define ADD(a, b) ((((a+MOD)%MOD)+((b+MOD)%MOD))%MOD)

#define MUL(a, b) ((((a)%MOD)*((b)%MOD))%MOD)

#define CEIL(x) ((int)ceil(((double)x)))

#define POW(x, y) ((int)pow(x, y))

#define UNIQUE(x) (x).erase(unique(ALL((x))), (x).end())

#define YES cout << "YES" << endl

#define NO cout << "NO" << endl

#define Yes cout << "Yes" << endl

#define No cout << "No" << endl

#define yes cout << "yes" << endl;

#define no cout << "no" << endl;

#define fcout cout << fixed << setprecision(10)

#define pb push_back

#define pf push_front

#define mp make_pair

#define mt make_tuple

#define lb lower_bound

#define ub upper_bound

#define fi first

#define se second

#define PI 3.1415926535897

#define EPS (1e-10)

#define INF INT_MAX

#define INFLL LLONG_MAX

#define MOD 1000000007

using llint = long long;

using VI = std::vector<int>;

using PII = std::pair<int, int>;

using SI = std::set<int>;

using MII = std::map<int, int>;

using TIII = std::tuple<int, int, int>;

using MCI = std::map<char, int>;

using VPII = std::vector<PII>;

using namespace std;





int N;

int x[100010];

MII d;





void makeD(){

	rep(i, 0, N){

		int a = x[i+1]-x[i];

		repif(i, 1, i*i <= a)

			if(a%i == 0) d[i]++, (a/i != i ? d[a/i]++ : 0);

	}

}





int solve(){

	for(auto it = d.rbegin();it != d.rend();it++)

		if(it->second == N) return it->first;

	return 1;

}





signed main(){

	cin >> N;

	rep(i, 0, N+1) cin >> x[i];



	sort(RNG(x, 0, N+1));



	makeD();



	cout << solve() << endl;



	return 0;

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

#define int long long

#define rep(i, a, n) for(int (i) = (int)(a);(i) < (int)(n);++(i))

#define repe(i, a, n) for(int (i) = (int)(a);(i) <= (int)(n);++(i))

#define repif(i, a, x) for(int (i) = (int)(a);(x);++(i))

#define repr(i, a, n) for(int (i) = ((int)(a)-1);(i) >= (int)(n);--(i))

#define reper(i, a, n) for(int (i) = (int)(a);(i) >= (int)(n);--(i))

#define chmax(a, b) a = max(a, b)

#define chmin(a, b) a = min(a, b)

#define SIZE(x) ((int)(x).size())

#define ALL(x) (x).begin(), (x).end()

#define RNG(x, a, n) &((x)[a]), &((x)[n])

#define ADD(a, b) ((((a+MOD)%MOD)+((b+MOD)%MOD))%MOD)

#define MUL(a, b) ((((a)%MOD)*((b)%MOD))%MOD)

#define CEIL(x) ((int)ceil(((double)x)))

#define POW(x, y) ((int)pow(x, y))

#define UNIQUE(x) (x).erase(unique(ALL((x))), (x).end())

#define YES cout << "YES" << endl

#define NO cout << "NO" << endl

#define Yes cout << "Yes" << endl

#define No cout << "No" << endl

#define yes cout << "yes" << endl;

#define no cout << "no" << endl;

#define fcout cout << fixed << setprecision(10)

#define pb push_back

#define mp make_pair

#define lb lower_bound

#define ub upper_bound

#define PI (acos(-1))

#define EPS (1e-10)

#define INF LLONG_MAX

#define MOD 1000000007

using namespace std;

using VI = vector<int>;

using PII = pair<int, int>;

using VPII = vector<PII>;

using Complex = complex<double>;





int N, X;

int x[100010];





int gcd(int a, int b){

	return a%b ? gcd(b, a%b) : b;

}





signed main(){

    cin >> N >> X;

    rep(i, 0, N) cin >> x[i], x[i] = abs(x[i]-X);



    int ans = x[0];

    rep(i, 1, N) ans = gcd(ans, x[i]);



    cout << ans << endl;



    return 0;

}

// Fastest known solution for this problem: