using System.Numerics; public class Program { public static void Main() { //int num = int.Parse(Console.ReadLine() ?? string.Empty); //string[] str = (Console.ReadLine() ?? string.Empty).Trim().Split(' '); //string str = Console.ReadLine() ?? string.Empty; List chars = []; for (int i = 0; i < 3; i++) { string str = Console.ReadLine() ?? string.Empty; chars.Add(str[0]); chars.Add(str[1]); chars.Add(str[2]); } for (int i = 0; i < chars.Count - 1; i++) { if (chars[i] == chars[i + 1]) { Console.WriteLine("No"); return; } } for (int i = 0; i < 3; i++) { if (chars[i] == chars[i + 3] )//|| chars[i] == chars[i + 6]) { Console.WriteLine("No"); return; } } Console.WriteLine("Yes"); } }