The GraySimilar Code

All submissions for this problem are available.
The Gray code (see wikipedia for more details) is a wellknown concept.
One of its important properties is that every two adjacent numbers have exactly one different digit in their binary representation.
In this problem, we will give you n nonnegative integers in a sequence A[1..n] (0<=A[i]<2^64), such that every two adjacent integers have exactly one different digit in their binary representation, similar to the Gray code.
Your task is to check whether there exist 4 numbers A[i1], A[i2], A[i3], A[i4] (1 <= i1 < i2 < i3 < i4 <= n) out of the given n numbers such that A[i1] xor A[i2] xor A[i3] xor A[i4] = 0. Here xor is a bitwise operation which is same as ^ in C, C++, Java and xor in Pascal.
Input
First line contains one integer n (4<=n<=100000).
Second line contains n space seperated nonnegative integers denoting the sequence A.
Output
Output “Yes” (quotes exclusive) if there exist four distinct indices i1, i2, i3, i4 such that A[i1] xor A[i2] xor A[i3] xor A[i4] = 0. Otherwise, output "No" (quotes exclusive) please.
Example
Input: 5 1 0 2 3 7 Output: Yes
Author:  shangjingbo 
Tester:  laycurse 
Editorial  http://discuss.codechef.com/problems/GRAYSC 
Tags  july12 medium pigeonhole search shangjingbo 
Date Added:  9052012 
Time Limit:  1 sec 
Source Limit:  50000 Bytes 
Languages:  ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.3.2, CPP 4.9.2, CPP14, CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
I hope its not necessary that
It would be too easy if they
@admin....all the numbers
@admin r all numbers
@himanshu23 nitish712 :Its
0<=A[i]<2^64 limits is in
@arun08 it means 0 <= A[i] <
@admin the quadruple whose
@admin is it necessary to
no it is not necessary
@selfcompiler got it !! :)
after 14 WA just because of
@admin: for the test
The only problem for me in
@f9pspo : use long long int
The group of four elements
I mean different index but
Use unsigned long long
@vineetsetia: 2 1 9 8 is the
@yugant123: 2, 1, 9, 8 do not
@setac: it does i think
In this problem, we will give
getting WA...and now fed up
what if adjacent numbers
@admin...plz respond...is
Is the php GMP extension
@admin please clarify whether
amazing how both the testers
@phantom11...plz clarify my
can we use pigeonhole
@kuruma i tried it but got wa
@vineetsetia : Sorry but I am
@kavishrox Thanks, I have no
@phantom11...i m waiting
are the four numbers
TLE!!
xorp=a[i] xor
This means there are bits
i have seen the submissions
Try this: 5 3 2 3 1 3