#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; r = 1 << n; vector> A(r, vector(r)); cout << "Yes\n"; if(n % 2 == 1){ for(int S = 0; S < r; S++){ for(int b = 0; b + 1 < n; b++){ A[S][S ^ (1 << b)] = __builtin_parity(S) ? -1 : 1; } A[S][S ^ (1 << (n - 1))] = (__builtin_parity(S) ? 1 : -1) * (n - 1); 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'; } } }