(defun splitat (c line)
  (labels ((rec (line acc)
				(let ((pos (position-if (lambda(cc) (char= c cc)) line)))
				  (if pos
					  (rec (subseq line (1+ pos)) (cons (subseq line 0 pos) acc))
					(nreverse (cons line acc))))))
	(rec line nil)))

(defun f ()
  (let* ((n (parse-integer(read-line nil nil)))
		 (lst0 (mapcar #'parse-integer (splitat #\space (read-line nil nil))))
		 (lst (cons (car lst0) (reverse lst0))))
	(labels ((rec (lst)
				  (if (null (cdddr lst))
					t
					(if (= (cadr lst) (logxor (car lst) (caddr lst)))
					  (rec (cdr lst))
					  nil))))
	  (format t "~A~%" (if (rec lst) "Yes" "No")))))
(compile 'f)
(f)