import java.util.*; import java.io.*; //Solution Credits: Taranpreet Singh class Editorial{ //SOLUTION BEGIN void solve(int TC) throws Exception{ int n = ni(); long[] a = new long[n]; for(int i = 0; i< n; i++)a[i] = nl(); if(n%2==1)pn("NO"); else{ boolean yes = true; for(int i = 0; i< n/2; i++){ if(Math.min(a[i], a[i+n/2])>0){ if(a[i]!=a[i+n/2]) yes = false; }else if(Math.max(a[i], a[i+n/2])==-1)a[i] = a[i+n/2] = 1; else{ long m = Math.max(a[i], a[i+n/2]); a[i] = a[i+n/2] = m; } } if(yes){ pn("YES"); for(long l:a)p(l+" ");pn(""); }else pn("NO"); } } //SOLUTION ENDS boolean multipleTC = true; FastReader in;PrintWriter out; void run() throws Exception{ in = new FastReader(); out = new PrintWriter(System.out); for(int i = 1, T = (multipleTC)?ni():1; i<= T; i++)solve(i); out.flush(); out.close(); } public static void main(String[] args) throws Exception{ new Editorial().run(); } void p(Object o){out.print(o);} void pn(Object o){out.println(o);} void pni(Object o){out.println(o);out.flush();} String n(){return in.next();} String nln(){return in.nextLine();} int ni(){return Integer.parseInt(in.next());} long nl(){return Long.parseLong(in.next());} double nd(){return Double.parseDouble(in.next());} class FastReader{ BufferedReader br; StringTokenizer st; public FastReader(){ br = new BufferedReader(new InputStreamReader(System.in)); } public FastReader(String s) throws Exception{ br = new BufferedReader(new FileReader(s)); } String next(){ while (st == null || !st.hasMoreElements()){ try{ st = new StringTokenizer(br.readLine()); }catch (IOException e){ e.printStackTrace(); } } return st.nextToken(); } String nextLine(){ String str = ""; try{ str = br.readLine(); }catch (IOException e){ e.printStackTrace(); } return str; } } }