jiahuimbzuai/CoQuIR huggingface dataset:
//  [java]
import java.io.IOException;
import java.io.InputStream;
import java.util.*;

public class Main {
	
    public static void main(String[] args) {
	FastScanner sc = new FastScanner();
	
	int a1 = sc.nextInt();
	int b1 = sc.nextInt();
	int a2 = sc.nextInt();
	int b2 = sc.nextInt();
	int a3 = sc.nextInt();
	int b3 = sc.nextInt();
	
	boolean can;
	
	int[] dig = new int[4];
	
	dig[a1-1] += 1;
	dig[a2-1] += 1;
	dig[a3-1] += 1;
	dig[b1-1] += 1;
	dig[b2-1] += 1;
	dig[b3-1] += 1;
	
	int odd = 0;
	for(int i=0;i<4;i++){
		if(!(dig[i]%2 == 0)){
			odd += 1;
		}
	}
	
	if(odd==0 || odd==2){
		can = true;
	}
	else{
		can = false;
	}

	if(can){
	    System.out.println("YES");
	}
	else{
	    System.out.println("NO");
	}
	
    }
    
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}
//  [java]

import java.util.Arrays;
import java.util.Scanner;

public class Main {


	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int[] count = new int[4];
		for (int i = 0; i < 6; i++) {
			int n = in.nextInt();
			count[n-1]++;
		}
		boolean yes = Arrays.stream(count).filter(n -> n >= 3).count() == 0;
		System.out.println(yes ? "YES" : "NO");
	}
}
//  [java]
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        Scanner scan = new Scanner(System.in);
        for (int i = 0; i < 6; i++) {
            list.add(scan.nextInt());
        }

        boolean isYes = list.stream().collect(
                Collectors.groupingBy(x -> x, Collectors.counting())).entrySet().stream().noneMatch(x -> x.getValue() >= 3);
        System.out.print(isYes ? "YES" : "NO");
    }
}
//  [java]
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		ArrayList<Integer> ary = new ArrayList<>();
		for(int i=0; i<6; i++) {
			ary.add(sc.nextInt());			
		}
		
		long countTown1 = ary.stream().filter(t -> t == 1).count();
		long countTown2 = ary.stream().filter(t -> t == 2).count();
		long countTown3 = ary.stream().filter(t -> t == 3).count();
		long countTown4 = ary.stream().filter(t -> t == 4).count();


		if(countTown1 > 2 || countTown2 > 2 || countTown3 > 2 || countTown4 > 2 ) {
			System.out.print("NO");			
		} else {
			System.out.print("YES");
		}
	}
}
//  [cpp]
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int gi(){
	int x=0,w=1;char ch=getchar();
	while((ch<'0'||ch>'9')&&ch!='-')ch=getchar();
	if(ch=='-')w=0,ch=getchar();
	while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
	return w?x:-x;
}
int a[10],b[10];
int main(){
	for(int i=1;i<=6;++i)++a[gi()];
	for(int i=1;i<=4;++i)++b[a[i]];
	puts(b[1]==2&&b[2]==2?"YES":"NO");
	return 0;
}
//  [cpp]
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
using namespace std;
namespace io{
    #define ll long long
    #define inf 0x3f3f3f3f
    #define il inline 
    #define in1(a) read(a)
    #define in2(a,b) in1(a),in1(b)
    #define in3(a,b,c) in2(a,b),in1(c)
    #define in4(a,b,c,d) in2(a,b),in2(c,d)
    il void readl(ll &x){
        x=0;ll f=1;char c=getchar();
        while(c<'0'||c>'9'){if(c=='-')f=-f;c=getchar();}
        while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
        x*=f;
    }
    il void read(int &x){
        x=0;int f=1;char c=getchar();
        while(c<'0'||c>'9'){if(c=='-')f=-f;c=getchar();}
        while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
        x*=f;
    }
}using namespace io;
int en,front[10],cnt;
struct edge{
	int v,nex;
}e[10];
bool vis[10],flag;
il void addedge(int u,int v){
	en++;
	e[en].v=v;
	e[en].nex=front[u];
	front[u]=en;
}
void dfs(int u){
	vis[u]=1;
	cnt++;
	bool f=0;
	for(int i=front[u];i;i=e[i].nex){
		int v=e[i].v;
		if(vis[v]) continue;
		f=1;
		dfs(v);
	}
	if(!f&&cnt<4) flag=1;
}
int main(){
	int a,b;
	for(int i=1;i<=3;i++){
		in2(a,b);
		addedge(a,b);
		addedge(b,a);
	}
	for(int i=1;i<=4;i++){
		memset(vis,0,sizeof(vis));
		cnt=0;
		flag=0;
		dfs(i);
		if(!flag){
			puts("YES");
			return 0;
		}
	}
	puts("NO");
	return 0;
}
//  [cpp]
#include<cstdio>
#include<algorithm>

using namespace std;

int cnt[10];

int main(){
	for(int i = 0; i < 6; ++i){
		int x;
		scanf("%d", &x);
		cnt[x]++;
	}
	int ma = 0;
	for(int i = 0; i < 10; ++i){
		ma = max(ma, cnt[i]);
	}
	if(ma == 2) printf("YES\n");
	else printf("NO\n");
	return 0;
}
//  [cpp]
#ifdef LOCAL
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstring>
#else
#include <bits/stdc++.h>
#endif
using namespace std ;

typedef long long ll ;
#define rep(i , n ) for ( int i =0; i < n ; i++)
#define _sort(arg) sort(begin(arg), end(arg))
#define MOD 1000000007
#define pb push_back
#define DEBUG(x) cout << #x << ": " << x << endl;

/*
__attribute__((constructor))
void initial()
{
	cin.tie(NULL);
	ios::sync_with_stdio(false);
}
*/

int main()
{
	cin.tie(NULL);
	ios::sync_with_stdio(false);

	int a[3], b[3];
	int n[4];
	memset(n, 0, sizeof(n));
	//cin >> A >> B >> C;
	rep(i, 3)
	{
		cin >> a[i] >> b[i];
		n[a[i]-1]++;
		n[b[i]-1]++;
	}

	sort(n, n+4);

	if ((n[0] != 1) || (n[1] != 1) || (n[2] != 2) || (n[3] != 2))
	{
		cout << "NO" << endl;
	}
	else
	{
		cout << "YES" << endl;
	}

	
	return 0;
}
//  [cpp]
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string>
using namespace std;
int main(){
int A, B, C, D ,E ,F;
  A = 0;
  B = 0;
  C = 0;
  D = 0;
long long int V[10000000] = {};
long long int G[10000000] = {};
string S,Sa,Sb,Sc;
bool ans = true;
cin >> V[0] >> G[0] >> V[1] >> G[1] >> V[2] >> G[2];
for(int i = 0;i < 3;i++){
if(V[i] == 1)A++;
if(G[i] == 1)A++;
if(V[i] == 2)B++;
if(G[i] == 2)B++;
if(V[i] == 3)C++;
if(G[i] == 3)C++;
if(V[i] == 4)D++;
if(G[i] == 4)D++;
}
if(A > 2 || B > 2 || C > 2 || D > 2)ans = false;
if(A == 0 || B == 0 || C == 0 || D == 0)ans = false;
if(ans)cout << "YES" << endl;
else cout << "NO" << endl;
return 0; 
}
//  [cpp]
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
    vector<int> cnt(4, 0);
    for (int i = 0; i < 6; ++i) {
        int a; cin >> a; cnt[a - 1]++;
    }
    if (cnt[0] == 1 && cnt[3] == 1 && cnt[1] == 2 && cnt[2] == 2) printf("%s\n", "YES");
    else printf("%s\n", "NO");
}
//  [c]
#include <stdio.h>

int main(){
	int road[4]={0,0,0,0};
	int a,b;
	int i;
	int count=0;
	
	for(i=0;i<3;i++){
		scanf("%d %d",&a,&b);
		road[a-1]++;
		road[b-1]++;
	}
	
	for(i=0;i<4;i++){
		if(road[i]%2==1)	count++;
	}
	
	if(count==2)	printf("YES");
	else	printf("NO");
	
	return 0;
}
//  [c]
#include <stdio.h>
int main(void){
    // Your code here!
    int town[4]={0,0,0,0},num1,num2,cnt=0;
    
    scanf("%d %d",&num1,&num2);
    town[num1-1]++; town[num2-1]++;
    scanf("%d %d",&num1,&num2);
    town[num1-1]++; town[num2-1]++;
    scanf("%d %d",&num1,&num2);
    town[num1-1]++; town[num2-1]++;
    
    for(int i=0;i<4;i++){
        if(town[i]%2==1){
            cnt++;
        }
    }
    
    if(cnt==0 || cnt==2){
        printf("YES\n");
    }else{
        printf("NO\n");
    }
}
//  [c]
#include <stdio.h>

int main(void) {

  int path[6];
  for (int i = 0; i < 6; i++) {
    scanf("%d", &path[i]);
  }
  int city[4];
  for (int i = 0; i < 4; i++) {
    city[i] = 0;
  }
  for (int i = 0; i < 6; i++) {
    city[path[i]-1]++;
  }
  int count1 = 0;
  int count2 = 0;
  for (int i = 0; i < 4; i++) {
    if (city[i] == 1) {
      count1++;
    }
    if (city[i] == 2) {
      count2++;
    }
  }
  if (count1 == 2 && count2 == 2) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }

  return 0;
}
//  [c]
#include <stdio.h>
int main(void)
{
  int a=0;int b=0;int c=0;int d=0;int e=0;int f=0;int g=0;
  scanf("%d",&a);
  scanf("%d",&b);
  scanf("%d",&c);
  scanf("%d",&d);
  scanf("%d",&e);
  scanf("%d",&f);
  g=a+b+c+d+e+f;
  if(g==15){
    printf("YES\n");
  }else{
    printf("NO\n");
  }
  return 0;
}
//  [c]
#include <stdio.h>

int main(void) {
	int kyan_tiaki[16] = {0};
	int yosinaga_sayuri = 0;
	int i;
	for (i = 0; i < 3; i++) {
		int a, b;
		if (scanf("%d%d", &a, &b) != 2) return 1;
		kyan_tiaki[a]++;
		kyan_tiaki[b]++;
	}
	for (i = 0; i < 16; i++) {
		yosinaga_sayuri += kyan_tiaki[i] % 2;
	}
	puts(yosinaga_sayuri <= 2 ? "YES" : "NO");
	return 0;
}
//  [javascript]
function Main(input) {
	input = input.split('');
        var counter=[0,0,0,0,0];
        for(var i=0;i<input.length;i++){
            for(var j=0;j<5;j++){
               if(input[i]===''+j)counter[j]++;
            }
        }
        for(var k=0;k<5;k++){
            if(counter[k]>2){
              console.log('NO');
              return 0;
            }
        }
        console.log('YES');
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
  input = input.split("\n");
  map = new Array(5).fill(0);
  for(var i=0;i<3;i++){
    tmp= input[i].split(" ");
    map[parseInt(tmp[0])]++;
    map[parseInt(tmp[1])]++;
  }
  var ans ="YES";
  for(var i=1;i<map.length;i++){
    if(map[i]==3){
      ans="NO";
    }else if(map[i]==0){
      ans="NO";
    }
  }

  console.log('%s', ans);
}
  
// "実行する"ボタンを押した時に実行される関数 (デバッグ用)
function debug(){
  var input = document.getElementById("input").value;
  Main(input);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(arg) {
	arg = arg.split("\n").map(e => e.split(" ").map(x => Number(x)).sort((a,b) => a - b))
	// console.log(arg)

	var val_count = [0,0,0,0] 


	var m = []
	for (var i = 0; i < arg.length; i++) {
		if (arg[i][0] === arg[i][1]) {
			console.log("NO")
			return;
		}

		val_count[arg[i][0] - 1]++
		val_count[arg[i][1] -1]++

		m.push(arg[i].join(""))
	}

	m.sort()

	for (var i = 1; i < m.length; i++ ) {
		if (m[i] === m[i-1]) {
			console.log("NO")
			return
		}
	}

	for (var i = 0; i < val_count.length; i++) {
		if (val_count[i] == 0 || val_count[i] > 2) {
			console.log("NO")
			return
		}
	}
	
	console.log("YES")

}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));

console.log(main());
function main(){
  var a = [0,0,0,0,0];
  a[o.a()]++;
  a[o.a()]++;
  a[o.a()]++;
  a[o.a()]++;
  a[o.a()]++;
  a[o.a()]++;
  return Math.max(...a) <= 2 ? "YES" : "NO";
}
//  [javascript]
function Main(input) {
    var input = input.split("\n");
    var an = true;
    var one = 0;
    var two = 0;
    var three = 0;
    var four = 0;
    t = 0;
    for(i = 0; i < 3; i++){
        n = input[i].split(" ");
        n[0] = Number(n[0]);n[1] = Number(n[1]);
        if(n[0] === 1) one++;
        else if(n[0] === 2) two++;
        else if(n[0] === 3) three++;
        else if(n[0] === 4) four++;
        if(n[1] === 1) one++;
        else if(n[1] === 2) two++;
        else if(n[1] === 3) three++;
        else if(n[1] === 4) four++;
    }
    if(one > 2 || two > 2 || three > 2 || four > 2) an = false;
    if(an) console.log("YES");
    else console.log("NO")
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
"use strict";
function I(s,f){this._s=s;this._c=0;this._l=0;this._f=f||Number}I.prototype.a=function(){var l=this._s.split("\n")[this._l];if(!l)return;var t=l.trim().split(" ");var a=t[this._c];this._c++;if(t.length===this._c){this._c=0;this._l++}return this._f(a)};I.prototype.l=function(){var l=this._s.split("\n")[this._l];this._c=0;this._l++;return l.split(" ").map(this._f)};

// TODO test and remove comment
function main(input) {
  const o = new I(input);

  const arr = Array(4).fill(0);
  for (let i=0;i<3;i++) {
    let a = o.a();
    let b = o.a();
    arr[a-1]++;
    arr[b-1]++;
  }

  if (arr.sort((a,b) => a-b).join(" ") === "1 1 2 2") {
    console.log("YES")
  } else {
    console.log("NO")
  }
}


main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import "fmt"

func main() {
	road := make([]int, 5)
	check := make([]int, 6)
	for i := 0; i < 3; i++ {
		var a, b int
		fmt.Scan(&a, &b)
		road[a]++
		road[b]++
	}
	for i := 1; i <= 4; i++ {
		check[road[i]-1]++
	}
	if check[0] == 2 && check[1] == 2 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}
//  [go]
package main

import "fmt"

func main() {
	xm := make(map[int]int)
	for i := 0; i < 3; i++ {
		var a, b int
		fmt.Scan(&a, &b)
		xm[a]++
		xm[b]++
	}

	if len(xm) != 4 {
		fmt.Println("NO")
	} else {
		c1, c2 := 0, 0
		for _, v := range xm {
			if v == 1 {
				c1++
			} else if v == 2 {
				c2++
			}
		}
		if c1 == 2 && c2 == 2 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(next(), 64)
	return f
}

func nextInts(n int) []int {
	slice := make([]int, n)
	for i := 0; i < n; i++ {
		slice[i] = nextInt()
	}
	return slice
}

func main() {
	sc.Split(bufio.ScanWords)
	cnt := make([]int, 4)
	for i := 0; i < 3; i++ {
		a, b := nextInt(), nextInt()
		cnt[a-1]++
		cnt[b-1]++
	}
	one := 0
	for _, v := range cnt {
		if v == 1 {
			one++
		}
	}

	if one == 2 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}
//  [go]
package main

import "fmt"

func main() {
	// Code for B - Path
	var a, b int
	c := make(map[int]int, 4)
	for i := 0; i < 3; i++ {
		fmt.Scanf("%d %d", &a, &b)
		c[a]++
		c[b]++
	}

	var count1, count2 int
	for _, v := range c {
		if v == 1 {
			count1++
		} else if v == 2 {
			count2++
		}
	}

	if count1 == 2 && count2 == 2 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}
//  [ruby]
count = (0..2).each_with_object(Hash.new(0)) {|_, hash|
    a, b = gets.chomp.split.map(&:to_i)
    hash[a] += 1
    hash[b] += 1
}.values

puts [count.min == 0, count.max > 2].any? ? :NO : :YES
//  [ruby]
#input of int(split by space)
def get_i()
  return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
  return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
  return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
  return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
  return bool ? y : n 
end
#create of array
def array(size1,init=nil,size2=-1)
  if size2==-1
    return Array.new(size1){init}
  else
    return Array.new(size2){Array.new(size1){init}}
  end
end

def max(a,b)
    return a>b ? a : b
end

def min(a,b)
    return a>b ? b : a
end

INF=Float::INFINITY

v=array(4,0)
3.times do|i|
  a,b=get_i.map{|x| x-=1}
  v[a]+=1
  v[b]+=1
end
v.each do|x|
    if x==3
        puts "NO"
        exit
    end
end
puts "YES"
//  [ruby]
edge = Array.new(4, 0)
3.times do
  a, b = gets.split.map(&:to_i)
  edge[a - 1] += 1
  edge[b - 1] += 1
end
puts (edge.max <= 2) ? "YES" : "NO"
//  [ruby]
h=Hash.new 0
`dd`.split.map{|a|h[a]+=1}
puts h.values.sort==[1,1,2,2]?:YES: :NO
//  [ruby]
require 'pp'
paths = [[], [], [], []]
3.times do |i|
  a,b = readline.chomp.split.map(&:to_i).map {|x| x-1}
  paths[a].push(b)
  paths[b].push(a)
end

ks = paths.map {|a| a.size }.sort

if ks == [1,1,2,2]
  puts 'YES'
else
  puts 'NO'
end
//  [ruby]
puts$<.read.split.group_by{|x|x}.any?{|x,y|y.size>2}?'NO':'YES'
//  [rust]
macro_rules! get {
    (Vec<$t:ty>) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
            get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            get!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn main() {
    let (a1, b1) = get!(usize, usize);
    let (a2, b2) = get!(usize, usize);
    let (a3, b3) = get!(usize, usize);

    // 次数3の頂点が存在するならばNO
    let mut dp = vec!(0; 5);
    dp[a1] += 1;
    dp[b1] += 1;
    dp[a2] += 1;
    dp[b2] += 1;
    dp[a3] += 1;
    dp[b3] += 1;
    let ans = if !dp.contains(&3) {
        "YES"
    } else {
        "NO"
    };

    println!("{}", ans);
}
//  [rust]
use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut scan = Scanner::new(cin);
    let mut g = vec![vec![];4];
    for _ in 0..3 {
        let a = scan.read::<i32>()-1;
        let b = scan.read::<i32>()-1;
        g[uz(a)].push(b);
        g[uz(b)].push(a);
    }
    let mut odd = 0;
    for i in 0..4 {
        if g[i].len() % 2 != 0 {odd+=1}
    }
    println!("{}", if odd == 2 || odd == 0 { "YES" } else {"NO"});
}

// region template
fn uz(i: i32) -> usize {i as usize}

struct Scanner<'a> {
    cin: StdinLock<'a>,
}

impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }

    fn read_opt<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }

    fn read<T: FromStr>(&mut self) -> T {
        self.read_opt().unwrap()
    }
}
// endregion
//  [rust]
#![allow(unused_imports)]
#![allow(unused_macros)]
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(unused_mut)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
use std::cmp::{max, min, Ordering};

macro_rules! get {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
            get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            get!($($t),*)
        ).collect::<Vec<_>>()
    };
    ($t:ty ;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty ;; $n:expr) => {
        (0..$n).map(|_| get!($t ;;)).collect::<Vec<_>>()
    };
}

// N M => let (N, M) = get!(usize, usize)
// A1 B1
// ...
// AQ BQ => let A = get!(usize, usize; Q)

const MOD: u64 = 1000000007;

fn main() {
    let edges = get!(usize, usize; 3);

    let mut cnt = vec![0, 0, 0, 0];
    for (fr, to) in edges {
        cnt[fr - 1] += 1;
        cnt[to - 1] += 1;
    }

    if cnt.iter().max() <= Some(&2) {
        println!("YES");
    } else {
        println!("NO");
    }
}
//  [rust]
#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use itertools::Itertools;

const U_INF: usize = 1 << 60;
const I_INF: isize = 1 << 60;

fn main() {
    let mut count = [0; 4];
    
    for _ in 0..3{
        let a: usize = read!();
        let b: usize = read!(); 
        
        count[a-1]+=1;
        count[b-1]+=1;
    }
    
    let c = count.iter().filter(|&&c| c%2!=0).count();
    
    println!("{}", if c == 0 || c == 2 { "YES" } else { "NO" });
}
//  [rust]
#![allow(unused_imports)]
#![allow(clippy::many_single_char_names)]

// language: Rust(1.42.0)
// check available crates on AtCoder at "https://atcoder.jp/contests/language-test-202001"
// My Library Repo' is at "https://github.com/Loptall/prcn_lib"

/*
    そう甘くはないんだな〜w
*/

// from std...
use std::cmp::{
    max, min, Ordering,
    Ordering::{Equal, Greater, Less},
    Reverse,
};
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
use std::convert::TryInto;
use std::mem::swap;
use std::num::{NonZeroU32, ParseIntError};
use std::ops::{
    Add, AddAssign, BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Div, DivAssign,
    Index, IndexMut, Mul, MulAssign, Neg, Rem, RemAssign, Shl, ShlAssign, Shr, ShrAssign, Sub,
    SubAssign,
};
use std::process::exit;
use std::{f32, f64, i128, i16, i32, i64, i8, isize, u128, u16, u32, u64, u8, usize};

// Dep' crates are...
use itertools::*;
use itertools_num::*;
use lazy_static::lazy_static;
use maplit::{btreemap, btreeset, hashmap, hashset};
use num_bigint::{BigInt, BigUint};
use num_complex::Complex;
use num_integer::{binomial, gcd, lcm, multinomial, Integer};
use num_rational::Rational;
use num_traits::{clamp, one, pow, zero, Num, NumAssignOps, NumOps, One, Pow, Zero};
use permutohedron::Heap;
use proconio::{
    fastout, input, is_stdin_empty,
    marker::{Bytes, Chars, Isize1, Usize1},
};
use rand::random;

pub const MOD10E9_7: usize = 1000000007;
pub const MOD99_: usize = 998244353;
pub const MAX: usize = std::usize::MAX;
pub const PI: f64 = f64::consts::PI;
pub const A: u8 = 65;

// code...
// #[fastout]
fn main() {
    input! {
        edges: [(Usize1, Usize1); 3]
    }

    let mut c = vec![0; 4];
    for (a, b) in edges {
        c[a] += 1;
        c[b] += 1;
    }

    let c = c.iter().filter(|x| *x % 2 == 1).count();
    if c == 0 || c == 2 {
        println!("YES");
    } else {
        println!("NO");
    }
}
//  [rust]
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use itertools::Itertools;
use std::process::exit;
use std::cmp::*;
use num::*;
use num::integer::Roots;

fn main() {
    input! {
    a:[usize;6],
    }
    let mut v=[0,0,0,0];
    for i in 0..6{
        v[a[i]-1]+=1;
        if v[a[i]-1]>2 {println!("NO");exit(0)}
    }
    println!("YES")
}
//  [swift]
var a=[0,0,0,0]
for _ in 0..<3{readLine()!.characters.split(" ").map{a[Int(String($0))!-1]++}}
print(a.maxElement()!==2 ?"YES":"NO")
//  [typescript]
export class Main {
  static main(input: string): string {
    const countList = [0, 0, 0, 0];
    const [p1, p2, p3] = input.split("\n");
    [p1, p2, p3].map(p => p.split(" ")).forEach(([a, b]) => {
      ++countList[a-1];
      ++countList[b-1];
    });
    let count1 = 0;
    let count2 = 0;
    countList.forEach(c => {
      switch (c) {
        case 1:
          ++count1;
          break;
        case 2:
          ++count2;
          break;
        default:
          break;
      }
    });
    return count1 == 2 && count2 == 2 ? "YES" : "NO";
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [python]
s = input()
t = input()
 
s_c = []
t_c = []
for c in 'abcdefghijklmnopqrstuvwxyz':
    s_c.append(s.count(c))
    t_c.append(t.count(c))
s_c.sort()
t_c.sort()
if s_c == t_c:
  print('Yes')
else:
  print('No')
//  [python]
s = input()
t = input()
alf = []
for i in range(97,123):
    alf.append(chr(i))
slist = []
tlist = []
for i in alf:
    slist.append(s.count(i))
    tlist.append(t.count(i))
slist.sort()
tlist.sort()
ans = "Yes"
for i in range(len(slist)):
    if slist[i] != tlist[i]:
        ans = "No"
print(ans)
//  [python]
def solve():
    S = input()
    T = input()
    
    s_counter = sorted([S.count(chr(i)) for i in range(ord('a'), ord('z') + 1)])
    t_counter = sorted([T.count(chr(i)) for i in range(ord('a'), ord('z') + 1)])
    if s_counter == t_counter:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    solve()
//  [python]
ai = lambda: list(map(int, input().split()))
ai_ = lambda: [int(x) - 1 for x in input().split()]

s = input()
t = input()

import string
S = string.ascii_lowercase

ss = [[] for _ in range(26)]
for i in range(26):
    for j in range(len(s)):
        if S[i] == s[j]:
            ss[i].append(j)
ss = [tuple(k) for k in ss]


tt = [[] for _ in range(26)]
for i in range(26):
    for j in range(len(s)):
        if S[i] == t[j]:
            tt[i].append(j)
tt = [tuple(k) for k in tt]


from collections import Counter
if Counter(ss) == Counter(tt):
    print('Yes')
else:
    print('No')
//  [python]
s=input()
t=input()
n=len(s)
A='abcdefghijklmnopqrstuvwxyz'
i=0
while A:
	if s==t:
		print('Yes')
		exit()
	if i==n:
		print('No')
		exit()
	if s[i]!=t[i]:
		if s[i] in A and t[i] in A:
			s=s.replace(s[i],'X').replace(t[i],s[i]).replace('X',t[i])
			A=A.replace(s[i],'').replace(t[i],'')
	i+=1
print('No')
//  [python]
s=input()
t=input()
n=len(s)
A='abcdefghijklmnopqrstuvwxyz'
i=0
while A:
    if s==t:
        print('Yes')
        exit()
    if i==n:
        print('No')
        exit()
    if s[i]==t[i]:
        if s[i] in A:
            A=A.replace(s[i],'')
    else:
        if s[i] in A and t[i] in A:
            if t[i] in s:
                A=A.replace(t[i],'')
                s=s.replace(s[i],'X').replace(t[i],s[i]).replace('X',t[i])
            else:
                A=A.replace(t[i],'')
                s=s.replace(s[i],t[i])
        else:
            print('No')
            exit()
    i+=1
//  [java]
	import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.NoSuchElementException;

	public class Main {
		static FastScanner sc;
		static PrintWriter out;
		public static void main(String[] args){
			sc = new FastScanner();
			out = new PrintWriter(System.out);
			out.println(solve());
			out.flush();
		}

		static String solve(){
			char[] S = sc.next().toCharArray();
			char[] T = sc.next().toCharArray();
			int[] repS = new int[26];
			int[] repT = new int[26];
			Arrays.fill(repS, -1);
			Arrays.fill(repT, -1);
			for(int i=0;i<S.length;i++){
				int tmpS = S[i]- 'a';
				int tmpT = T[i]- 'a';
				if(repS[tmpS]==-1 && repT[tmpT]==-1){
					repS[tmpS] = tmpT;
					repT[tmpT] = tmpS;
				}else if(tmpS == repT[tmpT] && tmpT == repS[tmpS]) continue;
				else return "No";
			}
			return "Yes";
		}
	}

	class FastScanner {
		private final InputStream in = System.in;
		private final byte[] buffer = new byte[1024];
		private int ptr = 0;
		private int buflen = 0;
		private boolean hasNextByte() {
			if (ptr < buflen) {
				return true;
			}else{
				ptr = 0;
				try {
					buflen = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (buflen <= 0) {
					return false;
				}
			}
			return true;
		}
		private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
		private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
		public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
		public String next() {
			if (!hasNext()) throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while(isPrintableChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
		public long nextLong() {
			if (!hasNext()) throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (b < '0' || '9' < b) {
				throw new NumberFormatException();
			}
			while(true){
				if ('0' <= b && b <= '9') {
					n *= 10;
					n += b - '0';
				}else if(b == -1 || !isPrintableChar(b)){
					return minus ? -n : n;
				}else{
					throw new NumberFormatException();
				}
				b = readByte();
			}
		}
		public int nextInt() {
			long nl = nextLong();
			if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
			return (int) nl;
		}
		public double nextDouble() { return Double.parseDouble(next());}
	}
//  [java]
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String T = sc.next();
        String[] s = S.split("");
        String[] t = T.split("");
        String ans = "Yes";
        //Map<String, String> map = new HashMap<>();
        List<String> list = new ArrayList<>();
        for(int i=0; i<s.length; i++) {
            if(s[i].equals(t[i])) {
                continue;
            }else {
                if(list.contains(t[i]) || list.contains(s[i])) {
                    ans = "No";
                    break;
                }else {
                    S = S.replaceAll(t[i], "#");
                    S = S.replaceAll(s[i], t[i]);
                    S = S.replaceAll("#", s[i]);
                    s = S.split("");
                    list.add(t[i]);
                }
            }
        }
        System.out.println(ans);
    }

}
//  [java]
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String T = sc.next();
		sc.close();

		String[][] count = new String[2][26];
		String[][] count2 = new String[2][26];
		int i = 0;
		for ( char c = 'a';c < ('a' + 26);c++) {
		    count[0][i] = String.valueOf(c);
		    count[1][i] = "-";
		    count2[0][i] = String.valueOf(c);
		    count2[1][i] = "-";
		    i++;
		}

		String ans ="Yes";
		for(int j = 0 ; j < S.length() ; j++){
			for(int k = 0 ; k < 26 ; k++){
				if(count[0][k].equals(S.substring(j, j+1)) && count[1][k].equals("-")){
					count[1][k] = T.substring(j, j+1);
					break;
				}
				else if(count[0][k].equals(S.substring(j, j+1)) && !count[1][k].equals(T.substring(j,j+1))){
					//System.out.println(k + " "+j + " " + 1);
					ans = "No";
					break;
				}
			}
		}

		for(int j = 0 ; j < T.length() ; j++){
			for(int k = 0 ; k < 26 ; k++){
				if(count2[0][k].equals(T.substring(j, j+1)) && count2[1][k].equals("-")){
					count2[1][k] = S.substring(j, j+1);
					break;
				}
				else if(count2[0][k].equals(T.substring(j, j+1)) && !count2[1][k].equals(S.substring(j,j+1))){
					//System.out.println(k + " "+j + " " + count2[1][k]  + " " + S.substring(j,j+1));
					ans = "No";
					break;
				}
			}
		}
		System.out.println(ans);

/*

		for(int k = 0 ; k < 26 ; k++){
				System.out.println(count2[0][k] + " " + count2[1][k]);
		}
*/
	}
}
//  [cpp]
/**
  * @file pb.cpp
  * @brief atcoder

  *

  * @author yao
  * @date 2018-09-23
  */
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <utility>
#include <algorithm>
#include <functional>
#define N 262144
#define INF ((int)1e9)
#ifdef DBG
#   define dbg_pri(x...) fprintf(stderr,x)
#else
#   define dbg_pri(x...) 0
#endif //DBG

typedef unsigned int uint;
typedef long long int lli;
typedef unsigned long long int ulli;

char s[N],t[N];
char mps[128],mpt[128];

int main()
{
    strtok(fgets(s,sizeof(s),stdin)," \t\r\n");
    strtok(fgets(t,sizeof(t),stdin)," \t\r\n");
    for(char *p=s,*q=t; *p; ++p,++q)
    {
        dbg_pri("poi 1: %c %c %c %c\n",*p,*q,mps[*p],mpt[*q]);
        if(mps[*p] && mps[*p]!=*q || mpt[*q] && mpt[*q]!=*p ) goto tag_no;
        mps[*p]=*q, mpt[*q]=*p;
    }
    return puts("Yes"),0;
tag_no:
    return puts("No"),0;
}
//  [cpp]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX_LEN 200000

int main(int argc, char *argv[]) {
  char S[MAX_LEN+2];
  char T[MAX_LEN+2];
  char map[128];
  int pointed[128];
  int len;
  fgets(S, MAX_LEN+2, stdin);
  fgets(T, MAX_LEN+2, stdin);
  len = strlen(S);
  // printf("S = %s", S);
  // printf("T = %s", T);
  // printf("len = %d\n", len);
  // fflush(stdout);
  for (int i = 0; i < 128; i++) {
    map[i] = -1;
    pointed[i] = 0;
  }
  for (int i = 0; i < len; i++) {
    char s = S[i], t = T[i];
    if (map[s] >= 0) {  // already an entry
      if (map[s] != t) {  // doesn't match previous
        printf("No\n");
        return 0;
      }
    } else {  // no entry yet
      map[s] = t;
      pointed[t]++;
      if (pointed[t] >= 2) {
        printf("No\n");
        return 0;
      }
    }
  }
  printf("Yes\n");
  return 0;
}
//  [cpp]
//Author:Nirmit Shah
//201701044
//Daiict,Gandhinagar
 
#include<bits/stdc++.h>
using namespace std;
 
//Macros
#define Fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define ll long long
#define error std::cerr
#define INF LONG_LONG_MAX
//#define MINF=LONG_LONG_MIN
#define MOD 1000000007
#define pii pair<int,int>
#define forn(i,j,n) for(ll i=j;i<n;i++)
#define mp make_pair
#define pb push_back
#define ull unsigned long long
 
//Debugging
#define deb1(x) cout<<#x<<" : "<<x<<endl;
#define deb2(x,y) cout<<#x<<" : "<<x<<"\t"<<#y<<" : "<<y<<endl;
#define deb3(x,y,z) cout<<#x<<" : "<<x<<"\t"<<#y<<" : "<<y<<"\t"<<#z<<" : "<<z<<endl;
 
#define all(c) c.begin(),c.end()
 
ll min(ll x,ll y)
{
    if(x>y)
        return y;
    return x;
}
 
ll max(ll x,ll y)
{
    if(x>y)
        return x;
    return y;
}
 
ll gcd(ll x,ll y)
{
    if(!x)
        return y;
    return gcd(y%x,x);
}
 
ll calcpower(ll x, ll y)
{
    ll ans = 1;
    x = x % MOD;
    while (y > 0)
    {
        if (y & 1)
            ans = (ans*x) % MOD;
 
            y = y>>1;
            x = (x*x) % MOD;
    }
    return ans;
}
 
/*bool prime[1000005];
void Sieve(ll n)
{
    for(int i=0; i<1000005; i++)
        prime[i] = true;
    prime[1] = false;
    prime[0] = false;
 
    for (ll p=2; p*p<=n; p++)
    {
        if (prime[p])
        {
            for (ll i=p*2; i<=n; i += p)
                prime[i] = false;
        }
    }
}*/
 
int main()
{
    Fast;
    string s,t;
    cin>>s>>t;
    
    int m1[256]={0},m2[256]={0};
        
        for(int i=0;i<s.length();i++)
        {
            if(m1[s[i]]!=m2[t[i]])
            {
                cout<<"No\n";
                return 0;
            }
            m1[s[i]]=i+1;
            m2[t[i]]=i+1;
        }
    cout<<"Yes\n";
    return 0;
}
//  [cpp]
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

int main()
{
	string S, T;
	cin >> S >> T;

	int N = S.size();
	const int len = 'z' - 'a' + 1;
	vector<string> s_table(len, "");
	vector<string> t_table(len, "");

	for (int i = 0; i < N; i++)
	{
		s_table[S[i] - 'a'].push_back(i);
		t_table[T[i] - 'a'].push_back(i);
	}

	bool flag = true;
	for (int i = 0; i < N; i++)
	{
		if (s_table[S[i] - 'a'].size() > 1
			&& s_table[S[i] - 'a'] != t_table[T[i] - 'a'])
		{
			flag = false;
			break;
		}

		if (t_table[T[i] - 'a'].size() > 1
			&& s_table[S[i] - 'a'] != t_table[T[i] - 'a'])
		{
			flag = false;
			break;
		}
	}

	if (flag)
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}

	return 0;
}
//  [cpp]
#include <cstdlib>
#include <iostream>
#include <string>
#include <time.h>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <vector>
#include <functional>
//#include "bits/stdc++.h"
using namespace std;
//using namespace std::vector;
#define rep(i,a,b) for(int i=(a);i<(b);++i)

#define huge 1000000007
typedef long long ll;
ll gcd(ll a, ll b);

int main(void) {

	ll N = 0;
	ll A = 0;
	ll B = 0;
	ll C = 0;
	ll D = 0;
	ll M = 0;
	//ll M = 0;
	ll a[200] = {};
	ll b[200] = {};
	ll v[3] = {};
	//ll *a, *b, *x;
	string S,T,U;
	ll count = 0;
	ll sum = 0;
	ll min = 100000;
	ll max = 0;
	int flag = 0;
	char temp,head;
	//int is = 0;
	

	//char p;
	cin >> S >> T;
	//cin >> S;
	
	rep(j, 0, S.length()) {

		if (S[j] != T[j]) {
			temp = S[j];
			rep(i, 0, S.length()) {
				

			
				if (temp == S[i]) {
					S[i] = T[j];
					sum++;
				}
				else if(T[j] == S[i]) {
					S[i] = temp;
					sum++;
				}

				if (sum > 0 && i < j) {
					break;
				}
				else {
					sum = 0;
				}

				
			}

		}

		if ((S == T) || sum >0)
			break;

		//cout << S << "," << T << endl;
	}

	//cout << S << "," << T << endl;

	//a = (ll *)malloc(M * sizeof(ll));
	//b = (ll *)malloc(M * sizeof(ll));
	//vector<pair<int,int>> ch(N+1);
	//vector<bool> flag(N);
	
	//count--;
	//	cout << X << endl;
	//x = (ll *)malloc((N+1) * sizeof(ll));
	//c = (ll *)malloc((N) * sizeof(ll));
	//cin >> D >> G;
	//vector<pair<int,int>> tr(M);
	//vector<pair<int,int>> qes(Q);
	//sort(v.begin(), v.end());
	
	/*A = N / 1000;
	N %= 1000;
	B = N / 100;
	N %= 100;
	C = N / 10;
	N %= 10;
	D = N;*/


	if (S == T) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}



	


	return 0;

}

ll gcd(ll a, ll b) {
	ll c;
	c = a % b;
	while (c != 0) {
		a = b;
		b = c;
		c = a % b;
	}

	return b;
}
//  [cpp]
#include <iostream>
#include <string.h>
#include <vector>
using namespace std;

int main () {
    string s, t;
    cin >> s >> t;
    int alphabet[26];
    for (int i = 0; i < 26; i++) {
        alphabet[i] = -1;
    }
    vector<vector<int> > all(26, vector<int> ());
    for (int i = 0; i < s.size(); i++) {
        all[s[i] - 97].push_back(i);       
    }

    for (int i = 0; i < s.size(); i++) {
        // まずは、s[i]が変わっていないか調べる
        if (s[i] == t[i] || alphabet[s[i] - 97] == 1) {
            // なにもしない
            if (s[i] != t[i]) {
                cout << "No" << endl;
                break;
            }
            alphabet[t[i] - 97] = 1;
        }
        else {
            // s[i]に該当するところを変えていく
            vector<int> ss;
            for (int j = 0; j < all[s[i] - 97].size(); j++) {
                int sub = all[s[i] - 97][j];
                if (sub != i) {
                    s[sub] = t[i];
                }
                if (sub < i) {
                    cout << "No" << endl;
                    return 0;
                }
            }
            for (int j = 0; j < all[t[i] - 97].size(); j++) {
                int sub = all[t[i] - 97][j];
                if (sub != i) {
                    s[sub] = s[i];
                }
            }
            all[s[i] - 97].swap(all[t[i] - 97]);
            s[i] = t[i];
            alphabet[t[i] - 97] = 1;
   
        }
        if (s == t) {
            cout << "Yes" << endl;
            break;
        }
        if (i == (s.size() - 1)) {
            if (s == t) {
                cout << "Yes" << endl;
            }    
            else {
                cout << "No" << endl;    
            }
        }
    }
}
//  [c]
#include<stdio.h>
#include<string.h>

#define MYSTRINGMAX 200000 // 配列20万分取る
#define SIZE MYSTRINGMAX + 2 // MYSTRINGMAX+2した値をSIZEに入れたものを定義する SIZE = 200002

int main(void) {
	char s[SIZE], t[SIZE];
	char c1[SIZE] = {0};
	char c2[SIZE] = {0};

	fgets(s, SIZE, stdin);
	fgets(t, SIZE, stdin);

	int length = strlen(s) - 1; // lengthに文字列の長さを返すstrlen関数を配列sにて判定する
	
	for (int i = 0; i < length; i++) {
		int in1 = s[i] - 'a';
		if (c1[in1] == 0) {
			c1[in1] = t[i];
		} else {
			if (c1[in1] != t[i]) {
				printf("No\n");
				return 0;
			}
		}
		int in2 = t[i] - 'a';
		if (c2[in2] == 0) {
			c2[in2] = s[i];
		} else {
			if (c2[in2] != s[i]) {
				printf("No\n");
				return 0;
			}
		}
	}
	printf("Yes\n"); // それ以外ならYesを実行
	return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>

int main(void){
    char s[200001];
    char t[200001];
    gets(s);
    gets(t);

    int rs[26];
    int rt[26];
    for(int i = 0; i < 26; i++){rs[i] = -1; rt[i] = -1;}

    int n = strlen(s);
    int a, b;
    for(int i = 0; i < n; i++){
        a = s[i] - 'a';
        b = t[i] - 'a';
        
        if(rs[a] != -1 || rt[b] != -1)
        {
            if(rs[a] != b || rt[b] != a)
            {
                printf("No\n");
                return 0;
            }
        }
        
        rs[a] = b;
        rt[b] = a;
    }

    printf("Yes\n");
    return 0;
}
//  [c]
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>

int main(int argc, char const* argv[])
{
    char S[(int)2e5 + 1], T[(int)2e5 + 1];
    char c['z' - 'a' + 1] = { 0 }, r['z' - 'a' + 1] = { 0 };
    size_t len;

    gets(S);
    gets(T);

    len = strlen(S);

    for (size_t i = 0; i < len; i++) {
        if (c[S[i] - 'a'] != 0 || r[T[i] - 'a'] != 0) {
            if ((c[S[i] - 'a']) != T[i]) {
                puts("No");
                return 0;
            }
            if ((r[T[i] - 'a']) != S[i]) {
                puts("No");
                return 0;
            }
        } else {
            c[S[i] - 'a'] = T[i];
            r[T[i] - 'a'] = S[i];
        }
    }

    puts("Yes");
    return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>
//小さい順にソート
char c[2][200002];
void merge(int i,int j,char s[2][200002]){
  if(i!=j){
    merge(i,(i+j)/2,s);
    merge((i+j)/2+1,j,s);
    int a=i,b=(i+j)/2+1;
    int d;
    for(d=i;d<=j;d++){
      if((i+j)/2<a){
        c[0][d]=s[0][b];
        c[1][d]=s[1][b];
        b++;
      }
      else if(j<b){
        c[0][d]=s[0][a];
        c[1][d]=s[1][a];
        a++;
      }
      else if(s[0][a]<s[0][b]){
        c[0][d]=s[0][a];
        c[1][d]=s[1][a];
        a++;
      }
      else{
        c[0][d]=s[0][b];
        c[1][d]=s[1][b];
        b++;
      }
    }
    for(d=i;d<=j;d++){
      s[0][d]=c[0][d];
      s[1][d]=c[1][d];
    }
  }
}

int main(){
  char s[2][200002];
  scanf("%s",s[0]);
  scanf("%s",s[1]);
  int len,i,change[27];
  for(i=0;i<27;i++)
    change[i]=0;
  len=strlen(s[0]);
  merge(0,len-1,s);
  for(i=0;i<len;i++)
    if(s[0][i]==s[1][i])
      change[s[0][i]-'a']=1;
  for(i=0;i<len;i++){
    if(i!=len && s[0][i]==s[0][i+1] && s[1][i]!=s[1][i+1]){
      puts("No");
      return 0;
    }
    else if(s[0][i]!=s[1][i] && change[s[1][i]-'a']==1){
      puts("No");
      return 0;
    }
    else if(s[0][i]!=s[0][i+1])
      change[s[1][i]-'a']=1;
  }
  puts("Yes");
  return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#define ALP 26
int dcm(const void *a,const void *b){
  return *(int *)b-*(int *)a;
}
int main(){
  int i,ok=1,alp1[ALP],alp2[ALP];
  for(i=0;i<ALP;i++){
    alp1[i]=0;
    alp2[i]=0;
  }
  char s;
  while(scanf("%c",&s)!=EOF&&s!='\n')alp1[s-97]++;
  while(scanf("%c",&s)!=EOF&&s!='\n')alp2[s-97]++;
  qsort(alp1,ALP,sizeof(int),dcm);
  qsort(alp2,ALP,sizeof(int),dcm);
  for(i=0;i<ALP;i++){
    if(alp1[i]==alp2[i])ok*=1;
    else ok*=0;
  }
  if(ok==1)printf("Yes");
  else printf("No");
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#define ALP 26

int compare_int(const void *a, const void *b) {
    return *(int*)a - *(int*)b;
}

int main() {
  int c = 1,alp1[ALP],alp2[ALP];
  for (int i = 0; i < ALP; i++) {
    alp1[i] = 0;
    alp2[i] = 0;
  }
  char s;
  while(scanf("%c",&s) != EOF && s != '\n') alp1[s-97]++;
  while(scanf("%c",&s) != EOF && s != '\n') alp2[s-97]++;
  qsort(alp1,26,sizeof(int),compare_int);
  qsort(alp2,26,sizeof(int),compare_int);
  for (int i = 0; i < ALP; i++) {
    if (alp1[i] == alp2[i]) c *= 1;
    else c *= 0;
  }
  if (c == 1) printf("Yes\n");
  else printf("No\n");
  return 0;
}
//  [javascript]
"use strict";
function Main(input) {
    let lines = input.split("\n");
    let s = lines[0];
    let t = lines[1];
// console.log(`len: ${s.length}`);
    const a = 'a'.charCodeAt(0);
    let sa = new Array(26).fill(0);
    let ta = new Array(26).fill(0);
    let result = false;
    for (let n = 0; n < s.length; n++) {
        if (sa[s.charCodeAt(n) - a] == 0) sa[s.charCodeAt(n) - a] = t.charCodeAt(n) - a;
        else if (sa[s.charCodeAt(n) - a] != t.charCodeAt(n) - a) {
            console.log('No');
            return;
        }
        if (ta[t.charCodeAt(n) - a] == 0) ta[t.charCodeAt(n) - a] = s.charCodeAt(n) - a;
        else if (ta[t.charCodeAt(n) - a] != s.charCodeAt(n) - a) {
            console.log('No');
            return;
        }
    }
    console.log('Yes');
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";var r=n(1);n(2)(r.readFileSync("/dev/stdin","utf8"))},function(t,e){t.exports=require("fs")},function(t,e,n){"use strict";var r=n(3),i=n(5);t.exports=function(t){var e=new r(t);i(e)}},function(t,e,n){"use strict";var r=n(4);t.exports=class{constructor(t){var e=t.trim().split(/\s+/g);this.inp=new r(e)}inr(){return this.inp.deq()}in(){return parseInt(this.inp.deq(),10)}fin(){this.inp.clear()}}},function(t,e,n){"use strict";t.exports=class{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.size=t.length,this.items=t,this.ind=0}enq(t){this.size+=1,this.items.push(t)}deq(){var t=this.items[this.ind];return this.size-=1,this.ind+=1,t}clear(){this.items=[],this.size=0,this.ind=0}}},function(t,e,n){"use strict";t.exports=function(t){for(var e=t.inr(),n=t.inr(),r=e.length,i=new Map,o=new Map,s=0;s<r;s++)if(i[e[s]]){if(i[e[s]]!=n[s])return void console.log("No")}else{if(i[e[s]]=n[s],o[n[s]]&&o[n[s]]!=e[s])return void console.log("No");o[n[s]]=e[s]}console.log("Yes")}}]);