(let* ((n (read))
       (x (make-hash-table :size n))
       a
       b
       f
       s)
  (loop :for _ :from 1 :to n
        :do (setf b a)
        :do (setf a (read))
        :do (if (gethash a x) (incf (gethash a x)) (setf (gethash a x) 1)))
  (setf f a)
  (setf s b)
  (loop :named main
        :for _ :from 1 :to (- n 2)
        :for c := (logxor a b)
        :if (and (gethash c x) (/= 0 (gethash c x)))
        :do (progn
              (decf (gethash c x))
              (setf a b
                    b c))
        :else
        :do (progn
              (format t "No~%")
              (return-from main))
        :finally (if (and (= (logxor a b) f) (= (logxor b f) s))
                     (format t "Yes~%")
                     (format t "No~%"))))
