import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int num = in.nextInt();
        List<Integer> nl = new ArrayList<>(num);
        while (in.hasNextInt()) {
            nl.add(in.nextInt());
        }
        int a = nl.get(0);
        int b = 0;
        int c = 0;
        int ac = 0;
        int bc = 0;
        int cc = 0;
        boolean isNo = false;
        String ans = "No";
        for (int i = 0; i < nl.size(); i++) {
            if (nl.get(i) != a) {
                b = nl.get(i);
                break;
            }
        }
        for (int i = 0; i < nl.size(); i++) {
            if (nl.get(i) != a && nl.get(i) != b) {
                c = nl.get(i);
                break;
            }
        }
        for (int i = 0; i < nl.size(); i++) {
            if (nl.get(i) == a) {
                ac++;
            } else if (nl.get(i) == b) {
                bc++;
            } else if (nl.get(i) == c) {
                cc++;
            } else {
                isNo = true;
            }
        }
        if ((a ^ b) != c) {
            isNo = true;
        }
        if (ac == bc && ac == cc && !isNo) {
            ans = "Yes";
        }
        System.out.println(ans);
        
    }
}