<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">import java.util.Scanner;
import java.util.*;

public class C {
	public static void main(String args[]) {
		Scanner s = new Scanner(System.in);
		int cases = s.nextInt();

		while (cases-- &gt; 0) {
			int a1 = s.nextInt(), b1 = s.nextInt(), c1 = s.nextInt(),
			    a2 = s.nextInt(), b2 = s.nextInt(), c2 = s.nextInt();

			boolean both_vertical = b1 == 0 &amp;&amp; b2 == 0;
			if (both_vertical) {
				boolean same_x_intercept = a1 * c2 == a2 * c1;	

				System.out.println(same_x_intercept ? "No" : "Yes");
			} else {
				boolean same_slope = a1 * b2 == a2 * b1;
				boolean same_y_intercept = b1 * c2 == b2 * c1;	

				System.out.println(same_slope &amp;&amp; ! same_y_intercept ? "Yes" : "No");
			}
		}
	}
}
</pre></body></html>