#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *, int *, int *, int *);
int main() {
  int a, b, c, d, e, a1, b1, c1, d1, e1;
  scanf("%d%d%d%d%d", &a, &b, &c, &d, &e);
  scanf("%d%d%d%d%d", &a1, &b1, &c1, &d1, &e1);
  if ((a == a1) || (b == b1) || (c == c1) || (d == d1) || (e == e1)) {
    printf("N\n");
  } else {
    printf("Y\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
lea    -0x18(%rbp),%r9
call   1040 <scanf@plt>
lea    0xeaa(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
lea    -0x28(%rbp),%r8
lea    -0x2c(%rbp),%r9
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x1c(%rbp),%eax
je     11ab <main+0x8b>
mov    -0xc(%rbp),%eax
cmp    -0x20(%rbp),%eax
je     11ab <main+0x8b>
mov    -0x10(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     11ab <main+0x8b>
mov    -0x14(%rbp),%eax
cmp    -0x28(%rbp),%eax
je     11ab <main+0x8b>
mov    -0x18(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jne    11bc <main+0x9c>
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
jmp    11c8 <main+0xa8>
lea    0xe4b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xed4(%rip),%rbx
lea    0x2c(%rsp),%rsi
lea    0x28(%rsp),%rdx
lea    0x24(%rsp),%rcx
lea    0x20(%rsp),%r8
lea    0x1c(%rsp),%r9
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x18(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
lea    0x8(%rsp),%r9
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x2c(%rsp),%eax
lea    0xe94(%rip),%rdi
cmp    0x18(%rsp),%eax
je     11b7 <main+0x97>
mov    0x28(%rsp),%eax
cmp    0x14(%rsp),%eax
je     11b7 <main+0x97>
mov    0x24(%rsp),%eax
cmp    0x10(%rsp),%eax
je     11b7 <main+0x97>
mov    0x20(%rsp),%eax
cmp    0xc(%rsp),%eax
je     11b7 <main+0x97>
mov    0x1c(%rsp),%eax
cmp    0x8(%rsp),%eax
lea    0xe61(%rip),%rax
lea    0xe58(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%d%d%d%d%d\00"
@.str.1 = [3 x i8] c"N\0A\00"
@.str.2 = [3 x i8] c"Y\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %1
%12 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5, i32* %6)
%13 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %7, i32* %8, i32* %9, i32* %10, i32* %11)
%14 = load i32, i32* %2
%15 = load i32, i32* %7
%16 = icmp eq i32 %14, %15
br i1 %16, label %33, label %17
17: ; preds = %0
%18 = load i32, i32* %3
%19 = load i32, i32* %8
%20 = icmp eq i32 %18, %19
br i1 %20, label %33, label %21
21: ; preds = %17
%22 = load i32, i32* %4
%23 = load i32, i32* %9
%24 = icmp eq i32 %22, %23
br i1 %24, label %33, label %25
25: ; preds = %21
%26 = load i32, i32* %5
%27 = load i32, i32* %10
%28 = icmp eq i32 %26, %27
br i1 %28, label %33, label %29
29: ; preds = %25
%30 = load i32, i32* %6
%31 = load i32, i32* %11
%32 = icmp eq i32 %30, %31
br i1 %32, label %33, label %35
33: ; preds = %29, %25, %21, %17, %0
%34 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %37
35: ; preds = %29
%36 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %37
37: ; preds = %35, %33
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%d%d%d%d%d\00"
@str = [2 x i8] c"Y\00"
@str.3 = [2 x i8] c"N\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = bitcast i32* %1 to i8*
%12 = bitcast i32* %2 to i8*
%13 = bitcast i32* %3 to i8*
%14 = bitcast i32* %4 to i8*
%15 = bitcast i32* %5 to i8*
%16 = bitcast i32* %6 to i8*
%17 = bitcast i32* %7 to i8*
%18 = bitcast i32* %8 to i8*
%19 = bitcast i32* %9 to i8*
%20 = bitcast i32* %10 to i8*
%21 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4, i32* %5)
%22 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7, i32* %8, i32* %9, i32* %10)
%23 = load i32, i32* %1
%24 = load i32, i32* %6
%25 = icmp eq i32 %23, %24
br i1 %25, label %43, label %26
26: ; preds = %0
%27 = load i32, i32* %2
%28 = load i32, i32* %7
%29 = icmp eq i32 %27, %28
br i1 %29, label %43, label %30
30: ; preds = %26
%31 = load i32, i32* %3
%32 = load i32, i32* %8
%33 = icmp eq i32 %31, %32
br i1 %33, label %43, label %34
34: ; preds = %30
%35 = load i32, i32* %4
%36 = load i32, i32* %9
%37 = icmp eq i32 %35, %36
br i1 %37, label %43, label %38
38: ; preds = %34
%39 = load i32, i32* %5
%40 = load i32, i32* %10
%41 = icmp eq i32 %39, %40
%42 = select i1 %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0)
br label %43
43: ; preds = %38, %0, %26, %30, %34
%44 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0), %34 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0), %30 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0), %26 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0), %0 ], [ %42, %38 ]
%45 = call i32 @puts(i8* dereferenceable(1) %44)
ret i32 0
}