#include using namespace std; template ostream& operator << (ostream& os, const vector& vec) { if(vec.empty()) return os; os << vec[0]; for(auto it = vec.begin(); ++it != vec.end(); ) os << ' ' << *it; return os; } int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, r; cin >> n; if(n == 1){ cout << "No\n"; return 0; } r = 1 << n; vector> A(r, vector(r)); cout << "Yes\n"; if(n % 2 == 1){ vector a(n - 3, 1); for(int i = 1; i < a.size(); i += 2) a[i] *= -1; a.emplace_back(1); a.emplace_back(1); a.emplace_back(-2); for(int S = 0; S < r; S++){ for(int b = 0; b < n; b++){ A[S][S ^ (1 << b)] = __builtin_parity(S) ? -a[b] : a[b]; } cout << A[S] << '\n'; } }else{ for(int S = 0; S < r; S++){ for(int b = 0; b < n; b++){ A[S][S ^ (1 << b)] = (__builtin_parity(S) ^ b) & 1 ? -1 : 1; } cout << A[S] << '\n'; } } /*for(int S = 0; S < r; S++){ for(int T = 0; T < r; T++){ assert(A[S][T] == -A[T][S]); } }*/ }