using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static long[] NList => ReadLine().Split().Select(long.Parse).ToArray(); static ulong[] LList(long n) => Enumerable.Repeat(0, (int)n).Select(_ => ulong.Parse(ReadLine())).ToArray(); public static void Main() { Solve(); } static void Solve() { var n = NN; var m = 1 << n; var a = LList(m); var blist = new ulong[n]; for (var i = 0; i < n; ++i) blist[i] = a[1 << i]; for (var i = 0; i < m; ++i) { var sub = (ulong)0; for (var j = 0; j < n; ++j) if ((i & (1 << j)) != 0) sub ^= blist[j]; if (sub != a[i]) { WriteLine("No"); return; } } WriteLine("Yes"); } }