This page is still under construction.

Parts of this page are still being built. What you see may change.

Four XOR

Time limit1sMemory limit256 MB

Summary
Given n distinct integers, decide whether four of them can be chosen so that their bitwise XOR is zero.
Level

Medium7 of 10

Topics
Bit manipulation, Brute force, Combinatorics, Hash map
Solved
No attempts yet

Problem

Given a sequence A1...nA_{1...n} of distinct integers, determine whether there exist four indices x,y,z,wx, y, z, w such that 1≤x<y<z<w≤n1 \le x < y < z < w \le n and Ax⊕Ay⊕Az⊕Aw=0A_x \oplus A_y \oplus A_z \oplus A_w = 0.

Here x⊕yx \oplus y is the bitwise exclusive-or of xx and yy, sometimes written xxoryx \mathrm{xor} y.

Input

The first line contains a single integer nn (4≤n≤1054 \le n \le 10^5).

The second line contains nn integers A1...nA_{1...n} (0≤Ai≤1050 \le A_i \le 10^5). All AiA_i are guaranteed to be distinct.

Output

Output "Yes" if four indices satisfying the conditions exist, or "No" otherwise.

Examples3

  1. Example 1

    Input
    5
    1 2 3 4 5
    
    Expected output
    Yes
    
  2. Example 2

    Input
    5
    1 2 4 8 16
    
    Expected output
    No
    
  3. Example 3

    Input
    5
    1 3 4 8 9
    
    Expected output
    No