#include <bits/stdc++.h>
using namespace std;

typedef int_fast32_t int32;
typedef int_fast64_t int64;

const int32 inf = 1e9+7;
const int32 MOD = 1000000007;
const int64 llinf = 1e18;

#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE\n" : "IMPOSSIBLE\n"  )
#define ANS(n) cout << (n) << "\n"
#define REP(i,n) for(int64 i=0;i<(n);++i)
#define FOR(i,a,b) for(int64 i=(a);i<(b);i++)
#define FORR(i,a,b) for(int64 i=(a);i>=(b);i--)
#define all(obj) (obj).begin(),(obj).end()
#define rall(obj) (obj).rbegin(),(obj).rend()
#define fi first
#define se second
#define pb(a) push_back(a)
typedef pair<int32,int32> pii;
typedef pair<int64,int64> pll;

template<class T> inline bool chmax(T& a, T b) {
  if (a < b) { a = b; return true; } return false;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) { a = b; return true; } return false;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<int32> a(3);
  REP(i,3)cin >> a[i];
  sort(all(a));
  Yes(a[1] - a[0] == a[2] - a[1]);
  return 0;
}
#include<cstdio>
#include<cstring>
#define N 300001
using namespace std;
bool chose[N];
int a[N],answer;
int n,left[N],right[N];
void dfs(int k)
{
	if (k==n)
	{
		int num=1;
		left[num]=1;
		for (int i=1;i<n;i++)
		{
			if (chose[i])
			{
				right[num]=i;
				left[++num]=i+1;	
			}		
		}
		right[num]=n;
		int ans=0;
		for (int i=1;i<=num;i++)
		{
			int cnt=0;
			for (int j=left[i];j<=right[i];j++) cnt|=a[j];
			ans^=cnt;
		}
		if (ans<answer) answer=ans;
		return;
	}
	chose[k]=false;
	dfs(k+1);
	chose[k]=true;
	dfs(k+1);
}
int main()
{
	scanf("%d",&n);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]);
	memset(chose,false,sizeof(chose));
	answer=2e9;
	dfs(1);
	printf("%d\n",answer);
}