public static void Main()
Console.WriteLine("Введите координаты первой клетки");
int x1 = int.Parse(Console.ReadLine());
int y1 = int.Parse(Console.ReadLine());
Console.WriteLine("Введите координаты второй клетки");
int x2 = int.Parse(Console.ReadLine());
int y2 = int.Parse(Console.ReadLine());
if (x1 == x2 || y1 == y2) Console.WriteLine("YES");
else if (x1 == y1 && x2 == y2) Console.WriteLine("YES");
else if (x1+y1 == 9 && x2+y2 == 9) Console.WriteLine("YES");
else Console.WriteLine("NO");