Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
int n,m;
int p[1<<17],r[1<<17];
int l[1<<17];
int find(int a){return p[a]-a?p[a]=find(p[a]):a;}
void unite(int a,int b)
{
	int pa=find(a),pb=find(b);
	if(pa==pb)return;
	if(r[pa]<r[pb])
	{
		p[pa]=pb;
	}
	else
	{
		p[pb]=pa;
		if(r[pa]==r[pb])r[pa]++;
	}
}
main()
{
	scanf("%d%d",&n,&m);
	for(int i=0;i<=n||i<=m;i++)l[i]=-1,p[i]=i;
	for(int i=0;i<n;i++)
	{
		int k,a;
		scanf("%d",&k);
		for(int j=0;j<k;j++)
		{
			scanf("%d",&a);
			if(l[a]<0)l[a]=i;
			else unite(i,l[a]);
		}
	}
	int f=1;
	for(int i=0;++i<n;)f&=find(0)==find(i);
	puts(f?"YES":"NO");
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 524288
p:
	.zero	524288
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 524288
r:
	.zero	524288
	.globl	l
	.align 32
	.type	l, @object
	.size	l, 524288
l:
	.zero	524288
	.text
	.globl	find
	.type	find, @function
find:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	je	.L2
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	find
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	p(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L4
.L2:
	movl	-4(%rbp), %eax
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	find, .-find
	.globl	unite
	.type	unite, @function
unite:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	find
	movl	%eax, -8(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	find
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	je	.L9
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	r(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L8
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L5
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	r(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L5
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L5
.L9:
	nop
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	unite, .-unite
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"YES"
.LC3:
	.string	"NO"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	m(%rip), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L11
.L12:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	l(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-44(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -44(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L12
	movl	m(%rip), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L12
	movl	$0, -40(%rbp)
	jmp	.L13
.L18:
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, -36(%rbp)
	jmp	.L14
.L17:
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	l(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jns	.L15
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	l(%rip), %rdx
	movl	-40(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L16
.L15:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	l(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-40(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	unite
.L16:
	addl	$1, -36(%rbp)
.L14:
	movl	-52(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L17
	addl	$1, -40(%rbp)
.L13:
	movl	n(%rip), %eax
	cmpl	%eax, -40(%rbp)
	jl	.L18
	movl	$1, -32(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L19
.L20:
	movl	$0, %edi
	call	find
	movl	%eax, %ebx
	movl	-28(%rbp), %eax
	movl	%eax, %edi
	call	find
	cmpl	%eax, %ebx
	sete	%al
	movzbl	%al, %eax
	andl	%eax, -32(%rbp)
.L19:
	addl	$1, -28(%rbp)
	movl	n(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L20
	cmpl	$0, -32(%rbp)
	je	.L21
	leaq	.LC2(%rip), %rax
	jmp	.L22
.L21:
	leaq	.LC3(%rip), %rax
.L22:
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	find
	.type	find, @function
find:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movslq	%edi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	p(%rip), %rbx
	movq	%rbp, %rax
	movl	(%rbx,%rbp,4), %edx
	cmpl	%ebp, %edx
	jne	.L9
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	movslq	%edx, %r12
	movl	(%rbx,%r12,4), %eax
	cmpl	%eax, %edx
	je	.L3
	movslq	%eax, %r13
	movl	(%rbx,%r13,4), %edx
	cmpl	%edx, %eax
	jne	.L10
.L4:
	movl	%edx, (%rbx,%r12,4)
	movl	%edx, %eax
.L3:
	movl	%eax, (%rbx,%rbp,4)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	movslq	%edx, %r14
	movl	(%rbx,%r14,4), %edi
	cmpl	%edi, %edx
	je	.L5
	call	find
	movl	%eax, (%rbx,%r14,4)
	movl	%eax, %edi
.L5:
	movl	%edi, (%rbx,%r13,4)
	movl	%edi, %edx
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	find, .-find
	.p2align 4
	.globl	unite
	.type	unite, @function
unite:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	p(%rip), %rcx
	movslq	%edi, %r9
	movl	%esi, %r8d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	(%rcx,%r9,4), %esi
	cmpl	%esi, %edi
	jne	.L37
.L12:
	movslq	%r8d, %r9
	movl	(%rcx,%r9,4), %eax
	cmpl	%eax, %r8d
	jne	.L38
.L23:
	cmpl	%esi, %eax
	je	.L11
	leaq	r(%rip), %rdx
	movslq	%esi, %rdi
	movslq	%eax, %r9
	movl	(%rdx,%rdi,4), %r8d
	cmpl	(%rdx,%r9,4), %r8d
	jge	.L33
	movl	%eax, (%rcx,%rdi,4)
.L11:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L33:
	.cfi_restore_state
	movl	%esi, (%rcx,%r9,4)
	jne	.L11
	addl	$1, %r8d
	movl	%r8d, (%rdx,%rdi,4)
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L38:
	.cfi_restore_state
	movslq	%eax, %r8
	movl	(%rcx,%r8,4), %edx
	cmpl	%edx, %eax
	je	.L24
	movslq	%edx, %r10
	movl	(%rcx,%r10,4), %eax
	cmpl	%eax, %edx
	jne	.L39
.L25:
	movl	%eax, (%rcx,%r8,4)
	movl	%eax, %edx
.L24:
	movl	%edx, (%rcx,%r9,4)
	movl	%edx, %eax
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L37:
	movslq	%esi, %r10
	movl	(%rcx,%r10,4), %eax
	cmpl	%eax, %esi
	je	.L13
	movslq	%eax, %rsi
	movl	(%rcx,%rsi,4), %edx
	cmpl	%edx, %eax
	jne	.L40
.L14:
	movl	%edx, (%rcx,%r10,4)
	movl	%edx, %eax
.L13:
	movl	%eax, (%rcx,%r9,4)
	movl	%eax, %esi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L40:
	movslq	%edx, %r11
	movl	(%rcx,%r11,4), %eax
	cmpl	%eax, %edx
	je	.L15
	movslq	%eax, %rbx
	movl	(%rcx,%rbx,4), %edx
	cmpl	%edx, %eax
	jne	.L41
.L16:
	movl	%edx, (%rcx,%r11,4)
	movl	%edx, %eax
.L15:
	movl	%eax, (%rcx,%rsi,4)
	movl	%eax, %edx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L39:
	movslq	%eax, %r11
	movl	(%rcx,%r11,4), %edx
	cmpl	%edx, %eax
	je	.L26
	movslq	%edx, %rbx
	movl	(%rcx,%rbx,4), %eax
	cmpl	%eax, %edx
	jne	.L42
.L27:
	movl	%eax, (%rcx,%r11,4)
	movl	%eax, %edx
.L26:
	movl	%edx, (%rcx,%r10,4)
	movl	%edx, %eax
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L42:
	movslq	%eax, %rbp
	movl	(%rcx,%rbp,4), %edx
	cmpl	%edx, %eax
	je	.L28
	movslq	%edx, %r12
	movl	(%rcx,%r12,4), %edi
	cmpl	%edi, %edx
	je	.L29
	movslq	%edi, %r13
	movl	(%rcx,%r13,4), %eax
	cmpl	%eax, %edi
	je	.L30
	movl	%eax, %edi
	call	find
	movl	%eax, (%rcx,%r13,4)
.L30:
	movl	%eax, (%rcx,%r12,4)
	movl	%eax, %edi
.L29:
	movl	%edi, (%rcx,%rbp,4)
	movl	%edi, %edx
.L28:
	movl	%edx, (%rcx,%rbx,4)
	movl	%edx, %eax
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L41:
	movslq	%edx, %rbp
	movl	(%rcx,%rbp,4), %eax
	cmpl	%eax, %edx
	je	.L17
	movslq	%eax, %r12
	movl	(%rcx,%r12,4), %edx
	cmpl	%edx, %eax
	je	.L18
	movslq	%edx, %r13
	movl	(%rcx,%r13,4), %eax
	cmpl	%eax, %edx
	je	.L19
	movslq	%eax, %r14
	movl	(%rcx,%r14,4), %edx
	cmpl	%edx, %eax
	je	.L20
	movslq	%edx, %r15
	movl	(%rcx,%r15,4), %eax
	cmpl	%eax, %edx
	je	.L35
	movslq	%eax, %rdx
	movl	(%rcx,%rdx,4), %edi
	movq	%rdx, 8(%rsp)
	cmpl	%edi, %eax
	je	.L22
	call	find
	movq	8(%rsp), %rdx
	movl	%eax, %edi
	movl	%eax, (%rcx,%rdx,4)
.L22:
	movl	%edi, (%rcx,%r15,4)
	movl	%edi, %edx
.L21:
	movl	%edx, (%rcx,%r14,4)
.L20:
	movl	%edx, (%rcx,%r13,4)
	movl	%edx, %eax
.L19:
	movl	%eax, (%rcx,%r12,4)
	movl	%eax, %edx
.L18:
	movl	%edx, (%rcx,%rbp,4)
	movl	%edx, %eax
.L17:
	movl	%eax, (%rcx,%rbx,4)
	movl	%eax, %edx
	jmp	.L16
.L35:
	movl	%eax, %edx
	jmp	.L21
	.cfi_endproc
.LFE1:
	.size	unite, .-unite
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"YES"
.LC1:
	.string	"NO"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	m(%rip), %rdx
	leaq	n(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC2(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	call	scanf@PLT
	movl	n(%rip), %edx
	xorl	%eax, %eax
	movl	m(%rip), %r8d
	leaq	l(%rip), %rdi
	leaq	p(%rip), %rsi
	jmp	.L44
	.p2align 4,,10
	.p2align 3
.L45:
	movl	$-1, (%rdi,%rax,4)
	movl	%ecx, (%rsi,%rax,4)
	addq	$1, %rax
.L44:
	movl	%eax, %ecx
	cmpl	%eax, %edx
	jge	.L45
	cmpl	%eax, %r8d
	jge	.L45
	testl	%edx, %edx
	jle	.L46
	xorl	%r12d, %r12d
	leaq	16(%rsp), %r15
	leaq	.LC3(%rip), %r13
	leaq	l(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L48:
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	call	scanf@PLT
	movl	16(%rsp), %eax
	leaq	20(%rsp), %r14
	testl	%eax, %eax
	jle	.L51
	.p2align 4,,10
	.p2align 3
.L47:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	20(%rsp), %rax
	movl	0(%rbp,%rax,4), %esi
	testl	%esi, %esi
	jns	.L49
	movl	%r12d, 0(%rbp,%rax,4)
	addl	$1, %ebx
	cmpl	%ebx, 16(%rsp)
	jg	.L47
.L51:
	movl	n(%rip), %edx
	addl	$1, %r12d
	cmpl	%r12d, %edx
	jg	.L48
.L46:
	cmpl	$1, %edx
	jle	.L52
	movl	$1, %ecx
	movl	$1, %r10d
	leaq	p(%rip), %rsi
	.p2align 4,,10
	.p2align 3
.L73:
	movl	(%rsi), %r8d
	movl	%ecx, %r9d
	testl	%r8d, %r8d
	je	.L53
	movslq	%r8d, %r11
	movl	(%rsi,%r11,4), %eax
	cmpl	%eax, %r8d
	je	.L54
	movslq	%eax, %r8
	movl	(%rsi,%r8,4), %edx
	cmpl	%edx, %eax
	je	.L55
	movslq	%edx, %rbx
	movl	(%rsi,%rbx,4), %eax
	cmpl	%eax, %edx
	jne	.L88
.L56:
	movl	%edx, (%rsi,%r8,4)
.L55:
	movl	%edx, (%rsi,%r11,4)
	movl	%edx, %eax
.L54:
	movl	%eax, (%rsi)
	movl	%eax, %r8d
.L53:
	movl	(%rsi,%rcx,4), %eax
	cmpl	%ecx, %eax
	je	.L63
	movslq	%eax, %r11
	movl	(%rsi,%r11,4), %r9d
	cmpl	%r9d, %eax
	je	.L64
	movslq	%r9d, %rbx
	movl	(%rsi,%rbx,4), %eax
	cmpl	%eax, %r9d
	je	.L65
	movslq	%eax, %r9
	movl	(%rsi,%r9,4), %edx
	cmpl	%edx, %eax
	jne	.L89
.L66:
	movl	%eax, (%rsi,%rbx,4)
.L65:
	movl	%eax, (%rsi,%r11,4)
	movl	%eax, %r9d
.L64:
	movl	%r9d, (%rsi,%rcx,4)
.L63:
	xorl	%eax, %eax
	cmpl	%r8d, %r9d
	sete	%al
	addq	$1, %rcx
	andl	%eax, %r10d
	cmpl	%ecx, n(%rip)
	jg	.L73
	leaq	.LC1(%rip), %rdi
	testl	%r10d, %r10d
	jne	.L52
.L74:
	call	puts@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L90
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L49:
	.cfi_restore_state
	movl	%r12d, %edi
	addl	$1, %ebx
	call	unite
	cmpl	%ebx, 16(%rsp)
	jg	.L47
	movl	n(%rip), %edx
	addl	$1, %r12d
	cmpl	%r12d, %edx
	jg	.L48
	jmp	.L46
.L89:
	movslq	%edx, %rbp
	movl	(%rsi,%rbp,4), %eax
	cmpl	%eax, %edx
	je	.L67
	movslq	%eax, %r12
	movl	(%rsi,%r12,4), %edx
	cmpl	%edx, %eax
	jne	.L91
.L68:
	movl	%edx, (%rsi,%rbp,4)
	movl	%edx, %eax
.L67:
	movl	%eax, (%rsi,%r9,4)
	jmp	.L66
.L88:
	movslq	%eax, %rbp
	movl	(%rsi,%rbp,4), %edx
	cmpl	%edx, %eax
	je	.L57
	movslq	%edx, %r12
	movl	(%rsi,%r12,4), %eax
	cmpl	%eax, %edx
	jne	.L92
.L58:
	movl	%eax, (%rsi,%rbp,4)
	movl	%eax, %edx
.L57:
	movl	%edx, (%rsi,%rbx,4)
	jmp	.L56
.L52:
	leaq	.LC0(%rip), %rdi
	jmp	.L74
.L92:
	movslq	%eax, %r13
	movl	(%rsi,%r13,4), %edx
	cmpl	%edx, %eax
	je	.L59
	movslq	%edx, %r14
	movl	(%rsi,%r14,4), %edi
	cmpl	%edi, %edx
	jne	.L93
.L60:
	movl	%edi, (%rsi,%r13,4)
	movl	%edi, %edx
.L59:
	movl	%edx, (%rsi,%r12,4)
	movl	%edx, %eax
	jmp	.L58
.L91:
	movslq	%edx, %r13
	movl	(%rsi,%r13,4), %eax
	cmpl	%eax, %edx
	je	.L69
	movslq	%eax, %r14
	movl	(%rsi,%r14,4), %edx
	cmpl	%edx, %eax
	jne	.L94
.L70:
	movl	%edx, (%rsi,%r13,4)
	movl	%edx, %eax
.L69:
	movl	%eax, (%rsi,%r12,4)
	movl	%eax, %edx
	jmp	.L68
.L94:
	movslq	%edx, %r15
	movl	(%rsi,%r15,4), %eax
	cmpl	%eax, %edx
	je	.L71
	movslq	%eax, %rdx
	movl	(%rsi,%rdx,4), %edi
	movq	%rdx, 8(%rsp)
	cmpl	%edi, %eax
	je	.L72
	call	find
	movq	8(%rsp), %rdx
	movl	%eax, %edi
	movl	%eax, (%rsi,%rdx,4)
.L72:
	movl	%edi, (%rsi,%r15,4)
	movl	%edi, %eax
.L71:
	movl	%eax, (%rsi,%r14,4)
	movl	%eax, %edx
	jmp	.L70
.L93:
	movslq	%edi, %r15
	movl	(%rsi,%r15,4), %eax
	cmpl	%eax, %edi
	je	.L61
	movslq	%eax, %rdx
	movl	(%rsi,%rdx,4), %edi
	movq	%rdx, 8(%rsp)
	cmpl	%edi, %eax
	je	.L62
	call	find
	movq	8(%rsp), %rdx
	movl	%eax, %edi
	movl	%eax, (%rsi,%rdx,4)
.L62:
	movl	%edi, (%rsi,%r15,4)
	movl	%edi, %eax
.L61:
	movl	%eax, (%rsi,%r14,4)
	movl	%eax, %edi
	jmp	.L60
.L90:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.globl	l
	.bss
	.align 32
	.type	l, @object
	.size	l, 524288
l:
	.zero	524288
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 524288
r:
	.zero	524288
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 524288
p:
	.zero	524288
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	find
	.type	find, @function
find:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movslq	%edi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	p(%rip), %rbx
	movq	%rbp, %rax
	movl	(%rbx,%rbp,4), %edx
	cmpl	%ebp, %edx
	jne	.L9
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	movslq	%edx, %r12
	movl	(%rbx,%r12,4), %eax
	cmpl	%eax, %edx
	je	.L3
	movslq	%eax, %r13
	movl	(%rbx,%r13,4), %edx
	cmpl	%edx, %eax
	jne	.L10
.L4:
	movl	%edx, (%rbx,%r12,4)
	movl	%edx, %eax
.L3:
	movl	%eax, (%rbx,%rbp,4)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	movslq	%edx, %r14
	movl	(%rbx,%r14,4), %edi
	cmpl	%edi, %edx
	je	.L5
	call	find
	movl	%eax, (%rbx,%r14,4)
	movl	%eax, %edi
.L5:
	movl	%edi, (%rbx,%r13,4)
	movl	%edi, %edx
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	find, .-find
	.p2align 4
	.globl	unite
	.type	unite, @function
unite:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	p(%rip), %rcx
	movslq	%edi, %r9
	movl	%esi, %r8d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	(%rcx,%r9,4), %esi
	cmpl	%esi, %edi
	jne	.L37
.L12:
	movslq	%r8d, %r9
	movl	(%rcx,%r9,4), %eax
	cmpl	%eax, %r8d
	jne	.L38
.L23:
	cmpl	%esi, %eax
	je	.L11
	leaq	r(%rip), %rdx
	movslq	%esi, %rdi
	movslq	%eax, %r9
	movl	(%rdx,%rdi,4), %r8d
	cmpl	(%rdx,%r9,4), %r8d
	jge	.L33
	movl	%eax, (%rcx,%rdi,4)
.L11:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L33:
	.cfi_restore_state
	movl	%esi, (%rcx,%r9,4)
	jne	.L11
	addl	$1, %r8d
	movl	%r8d, (%rdx,%rdi,4)
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L38:
	.cfi_restore_state
	movslq	%eax, %r8
	movl	(%rcx,%r8,4), %edx
	cmpl	%edx, %eax
	je	.L24
	movslq	%edx, %r10
	movl	(%rcx,%r10,4), %eax
	cmpl	%eax, %edx
	jne	.L39
.L25:
	movl	%eax, (%rcx,%r8,4)
	movl	%eax, %edx
.L24:
	movl	%edx, (%rcx,%r9,4)
	movl	%edx, %eax
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L37:
	movslq	%esi, %r10
	movl	(%rcx,%r10,4), %eax
	cmpl	%eax, %esi
	je	.L13
	movslq	%eax, %rsi
	movl	(%rcx,%rsi,4), %edx
	cmpl	%edx, %eax
	jne	.L40
.L14:
	movl	%edx, (%rcx,%r10,4)
	movl	%edx, %eax
.L13:
	movl	%eax, (%rcx,%r9,4)
	movl	%eax, %esi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L40:
	movslq	%edx, %r11
	movl	(%rcx,%r11,4), %eax
	cmpl	%eax, %edx
	je	.L15
	movslq	%eax, %rbx
	movl	(%rcx,%rbx,4), %edx
	cmpl	%edx, %eax
	jne	.L41
.L16:
	movl	%edx, (%rcx,%r11,4)
	movl	%edx, %eax
.L15:
	movl	%eax, (%rcx,%rsi,4)
	movl	%eax, %edx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L39:
	movslq	%eax, %r11
	movl	(%rcx,%r11,4), %edx
	cmpl	%edx, %eax
	je	.L26
	movslq	%edx, %rbx
	movl	(%rcx,%rbx,4), %eax
	cmpl	%eax, %edx
	jne	.L42
.L27:
	movl	%eax, (%rcx,%r11,4)
	movl	%eax, %edx
.L26:
	movl	%edx, (%rcx,%r10,4)
	movl	%edx, %eax
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L42:
	movslq	%eax, %rbp
	movl	(%rcx,%rbp,4), %edx
	cmpl	%edx, %eax
	je	.L28
	movslq	%edx, %r12
	movl	(%rcx,%r12,4), %edi
	cmpl	%edi, %edx
	je	.L29
	movslq	%edi, %r13
	movl	(%rcx,%r13,4), %eax
	cmpl	%eax, %edi
	je	.L30
	movl	%eax, %edi
	call	find
	movl	%eax, (%rcx,%r13,4)
.L30:
	movl	%eax, (%rcx,%r12,4)
	movl	%eax, %edi
.L29:
	movl	%edi, (%rcx,%rbp,4)
	movl	%edi, %edx
.L28:
	movl	%edx, (%rcx,%rbx,4)
	movl	%edx, %eax
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L41:
	movslq	%edx, %rbp
	movl	(%rcx,%rbp,4), %eax
	cmpl	%eax, %edx
	je	.L17
	movslq	%eax, %r12
	movl	(%rcx,%r12,4), %edx
	cmpl	%edx, %eax
	je	.L18
	movslq	%edx, %r13
	movl	(%rcx,%r13,4), %eax
	cmpl	%eax, %edx
	je	.L19
	movslq	%eax, %r14
	movl	(%rcx,%r14,4), %edx
	cmpl	%edx, %eax
	je	.L20
	movslq	%edx, %r15
	movl	(%rcx,%r15,4), %eax
	cmpl	%eax, %edx
	je	.L35
	movslq	%eax, %rdx
	movl	(%rcx,%rdx,4), %edi
	movq	%rdx, 8(%rsp)
	cmpl	%edi, %eax
	je	.L22
	call	find
	movq	8(%rsp), %rdx
	movl	%eax, %edi
	movl	%eax, (%rcx,%rdx,4)
.L22:
	movl	%edi, (%rcx,%r15,4)
	movl	%edi, %edx
.L21:
	movl	%edx, (%rcx,%r14,4)
.L20:
	movl	%edx, (%rcx,%r13,4)
	movl	%edx, %eax
.L19:
	movl	%eax, (%rcx,%r12,4)
	movl	%eax, %edx
.L18:
	movl	%edx, (%rcx,%rbp,4)
	movl	%edx, %eax
.L17:
	movl	%eax, (%rcx,%rbx,4)
	movl	%eax, %edx
	jmp	.L16
.L35:
	movl	%eax, %edx
	jmp	.L21
	.cfi_endproc
.LFE1:
	.size	unite, .-unite
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"YES"
.LC1:
	.string	"NO"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	m(%rip), %rdx
	leaq	n(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC2(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	call	scanf@PLT
	movl	n(%rip), %edx
	xorl	%eax, %eax
	movl	m(%rip), %r8d
	leaq	l(%rip), %rdi
	leaq	p(%rip), %rsi
	jmp	.L44
	.p2align 4,,10
	.p2align 3
.L45:
	movl	$-1, (%rdi,%rax,4)
	movl	%ecx, (%rsi,%rax,4)
	addq	$1, %rax
.L44:
	movl	%eax, %ecx
	cmpl	%eax, %edx
	jge	.L45
	cmpl	%eax, %r8d
	jge	.L45
	testl	%edx, %edx
	jle	.L46
	xorl	%r12d, %r12d
	leaq	16(%rsp), %r15
	leaq	.LC3(%rip), %r13
	leaq	l(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L48:
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	call	scanf@PLT
	movl	16(%rsp), %eax
	leaq	20(%rsp), %r14
	testl	%eax, %eax
	jle	.L51
	.p2align 4,,10
	.p2align 3
.L47:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	20(%rsp), %rax
	movl	0(%rbp,%rax,4), %esi
	testl	%esi, %esi
	jns	.L49
	movl	%r12d, 0(%rbp,%rax,4)
	addl	$1, %ebx
	cmpl	%ebx, 16(%rsp)
	jg	.L47
.L51:
	movl	n(%rip), %edx
	addl	$1, %r12d
	cmpl	%r12d, %edx
	jg	.L48
.L46:
	cmpl	$1, %edx
	jle	.L52
	movl	$1, %ecx
	movl	$1, %r10d
	leaq	p(%rip), %rsi
	.p2align 4,,10
	.p2align 3
.L73:
	movl	(%rsi), %r8d
	movl	%ecx, %r9d
	testl	%r8d, %r8d
	je	.L53
	movslq	%r8d, %r11
	movl	(%rsi,%r11,4), %eax
	cmpl	%eax, %r8d
	je	.L54
	movslq	%eax, %r8
	movl	(%rsi,%r8,4), %edx
	cmpl	%edx, %eax
	je	.L55
	movslq	%edx, %rbx
	movl	(%rsi,%rbx,4), %eax
	cmpl	%eax, %edx
	jne	.L88
.L56:
	movl	%edx, (%rsi,%r8,4)
.L55:
	movl	%edx, (%rsi,%r11,4)
	movl	%edx, %eax
.L54:
	movl	%eax, (%rsi)
	movl	%eax, %r8d
.L53:
	movl	(%rsi,%rcx,4), %eax
	cmpl	%ecx, %eax
	je	.L63
	movslq	%eax, %r11
	movl	(%rsi,%r11,4), %r9d
	cmpl	%r9d, %eax
	je	.L64
	movslq	%r9d, %rbx
	movl	(%rsi,%rbx,4), %eax
	cmpl	%eax, %r9d
	je	.L65
	movslq	%eax, %r9
	movl	(%rsi,%r9,4), %edx
	cmpl	%edx, %eax
	jne	.L89
.L66:
	movl	%eax, (%rsi,%rbx,4)
.L65:
	movl	%eax, (%rsi,%r11,4)
	movl	%eax, %r9d
.L64:
	movl	%r9d, (%rsi,%rcx,4)
.L63:
	xorl	%eax, %eax
	cmpl	%r8d, %r9d
	sete	%al
	addq	$1, %rcx
	andl	%eax, %r10d
	cmpl	%ecx, n(%rip)
	jg	.L73
	leaq	.LC1(%rip), %rdi
	testl	%r10d, %r10d
	jne	.L52
.L74:
	call	puts@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L90
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L49:
	.cfi_restore_state
	movl	%r12d, %edi
	addl	$1, %ebx
	call	unite
	cmpl	%ebx, 16(%rsp)
	jg	.L47
	movl	n(%rip), %edx
	addl	$1, %r12d
	cmpl	%r12d, %edx
	jg	.L48
	jmp	.L46
.L89:
	movslq	%edx, %rbp
	movl	(%rsi,%rbp,4), %eax
	cmpl	%eax, %edx
	je	.L67
	movslq	%eax, %r12
	movl	(%rsi,%r12,4), %edx
	cmpl	%edx, %eax
	jne	.L91
.L68:
	movl	%edx, (%rsi,%rbp,4)
	movl	%edx, %eax
.L67:
	movl	%eax, (%rsi,%r9,4)
	jmp	.L66
.L88:
	movslq	%eax, %rbp
	movl	(%rsi,%rbp,4), %edx
	cmpl	%edx, %eax
	je	.L57
	movslq	%edx, %r12
	movl	(%rsi,%r12,4), %eax
	cmpl	%eax, %edx
	jne	.L92
.L58:
	movl	%eax, (%rsi,%rbp,4)
	movl	%eax, %edx
.L57:
	movl	%edx, (%rsi,%rbx,4)
	jmp	.L56
.L52:
	leaq	.LC0(%rip), %rdi
	jmp	.L74
.L92:
	movslq	%eax, %r13
	movl	(%rsi,%r13,4), %edx
	cmpl	%edx, %eax
	je	.L59
	movslq	%edx, %r14
	movl	(%rsi,%r14,4), %edi
	cmpl	%edi, %edx
	jne	.L93
.L60:
	movl	%edi, (%rsi,%r13,4)
	movl	%edi, %edx
.L59:
	movl	%edx, (%rsi,%r12,4)
	movl	%edx, %eax
	jmp	.L58
.L91:
	movslq	%edx, %r13
	movl	(%rsi,%r13,4), %eax
	cmpl	%eax, %edx
	je	.L69
	movslq	%eax, %r14
	movl	(%rsi,%r14,4), %edx
	cmpl	%edx, %eax
	jne	.L94
.L70:
	movl	%edx, (%rsi,%r13,4)
	movl	%edx, %eax
.L69:
	movl	%eax, (%rsi,%r12,4)
	movl	%eax, %edx
	jmp	.L68
.L94:
	movslq	%edx, %r15
	movl	(%rsi,%r15,4), %eax
	cmpl	%eax, %edx
	je	.L71
	movslq	%eax, %rdx
	movl	(%rsi,%rdx,4), %edi
	movq	%rdx, 8(%rsp)
	cmpl	%edi, %eax
	je	.L72
	call	find
	movq	8(%rsp), %rdx
	movl	%eax, %edi
	movl	%eax, (%rsi,%rdx,4)
.L72:
	movl	%edi, (%rsi,%r15,4)
	movl	%edi, %eax
.L71:
	movl	%eax, (%rsi,%r14,4)
	movl	%eax, %edx
	jmp	.L70
.L93:
	movslq	%edi, %r15
	movl	(%rsi,%r15,4), %eax
	cmpl	%eax, %edi
	je	.L61
	movslq	%eax, %rdx
	movl	(%rsi,%rdx,4), %edi
	movq	%rdx, 8(%rsp)
	cmpl	%edi, %eax
	je	.L62
	call	find
	movq	8(%rsp), %rdx
	movl	%eax, %edi
	movl	%eax, (%rsi,%rdx,4)
.L62:
	movl	%edi, (%rsi,%r15,4)
	movl	%edi, %eax
.L61:
	movl	%eax, (%rsi,%r14,4)
	movl	%eax, %edi
	jmp	.L60
.L90:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.globl	l
	.bss
	.align 32
	.type	l, @object
	.size	l, 524288
l:
	.zero	524288
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 524288
r:
	.zero	524288
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 524288
p:
	.zero	524288
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

int n,m;
int p[1<<17],r[1<<17];
int l[1<<17];
int find(int a){return p[a]-a?p[a]=find(p[a]):a;}
void unite(int a,int b)
{
	int pa=find(a),pb=find(b);
	if(pa==pb)return;
	if(r[pa]<r[pb])
	{
		p[pa]=pb;
	}
	else
	{
		p[pb]=pa;
		if(r[pa]==r[pb])r[pa]++;
	}
}
main()
{
	scanf("%d%d",&n,&m);
	for(int i=0;i<=n||i<=m;i++)l[i]=-1,p[i]=i;
	for(int i=0;i<n;i++)
	{
		int k,a;
		scanf("%d",&k);
		for(int j=0;j<k;j++)
		{
			scanf("%d",&a);
			if(l[a]<0)l[a]=i;
			else unite(i,l[a]);
		}
	}
	int f=1;
	for(int i=0;++i<n;)f&=find(0)==find(i);
	puts(f?"YES":"NO");
}

4 6
3 1 2 3
2 4 2
2 4 6
1 6

YES

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
int n,m;
int p[1<<17],r[1<<17];
int l[1<<17];
int find(int a){return p[a]-a?p[a]=find(p[a]):a;}
void unite(int a,int b)
{
	int pa=find(a),pb=find(b);
	if(pa==pb)return;
	if(r[pa]<r[pb])
	{
		p[pa]=pb;
	}
	else
	{
		p[pb]=pa;
		if(r[pa]==r[pb])r[pa]++;
	}
}
main()
{
	scanf("%d%d",&n,&m);
	for(int i=0;i<=n||i<=m;i++)l[i]=-1,p[i]=i;
	for(int i=0;i<n;i++)
	{
		int k,a;
		scanf("%d",&k);
		for(int j=0;j<k;j++)
		{
			scanf("%d",&a);
			if(l[a]<0)l[a]=i;
			else unite(i,l[a]);
		}
	}
	int f=1;
	for(int i=0;++i<n;)f&=find(0)==find(i);
	puts(f?"YES":"NO");
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 524288
p:
	.zero	524288
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 524288
r:
	.zero	524288
	.globl	l
	.align 32
	.type	l, @object
	.size	l, 524288
l:
	.zero	524288
	.text
	.globl	find
	.type	find, @function
find:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	je	.L2
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	find
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	p(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L4
.L2:
	movl	-4(%rbp), %eax
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	find, .-find
	.globl	unite
	.type	unite, @function
unite:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	find
	movl	%eax, -8(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	find
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	je	.L9
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	r(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L8
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L5
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	r(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L5
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L5
.L9:
	nop
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	unite, .-unite
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"YES"
.LC3:
	.string	"NO"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	m(%rip), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L11
.L12:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	l(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-44(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -44(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L12
	movl	m(%rip), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L12
	movl	$0, -40(%rbp)
	jmp	.L13
.L18:
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, -36(%rbp)
	jmp	.L14
.L17:
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	l(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jns	.L15
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	l(%rip), %rdx
	movl	-40(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L16
.L15:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	l(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-40(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	unite
.L16:
	addl	$1, -36(%rbp)
.L14:
	movl	-52(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L17
	addl	$1, -40(%rbp)
.L13:
	movl	n(%rip), %eax
	cmpl	%eax, -40(%rbp)
	jl	.L18
	movl	$1, -32(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L19
.L20:
	movl	$0, %edi
	call	find
	movl	%eax, %ebx
	movl	-28(%rbp), %eax
	movl	%eax, %edi
	call	find
	cmpl	%eax, %ebx
	sete	%al
	movzbl	%al, %eax
	andl	%eax, -32(%rbp)
.L19:
	addl	$1, -28(%rbp)
	movl	n(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L20
	cmpl	$0, -32(%rbp)
	je	.L21
	leaq	.LC2(%rip), %rax
	jmp	.L22
.L21:
	leaq	.LC3(%rip), %rax
.L22:
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 524288
p:
	.zero	524288
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 524288
r:
	.zero	524288
	.globl	l
	.align 32
	.type	l, @object
	.size	l, 524288
l:
	.zero	524288
	.text
	.globl	find
	.type	find, @function
find:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	je	.L2
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	find
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	p(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L4
.L2:
	movl	-4(%rbp), %eax
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	find, .-find
	.globl	unite
	.type	unite, @function
unite:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	find
	movl	%eax, -8(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	find
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	je	.L9
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	r(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L8
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L5
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	r(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L5
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L5
.L9:
	nop
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	unite, .-unite
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"YES"
.LC3:
	.string	"NO"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	m(%rip), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L11
.L12:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	l(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-44(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -44(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L12
	movl	m(%rip), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L12
	movl	$0, -40(%rbp)
	jmp	.L13
.L18:
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, -36(%rbp)
	jmp	.L14
.L17:
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	l(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jns	.L15
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	l(%rip), %rdx
	movl	-40(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L16
.L15:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	l(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-40(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	unite
.L16:
	addl	$1, -36(%rbp)
.L14:
	movl	-52(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L17
	addl	$1, -40(%rbp)
.L13:
	movl	n(%rip), %eax
	cmpl	%eax, -40(%rbp)
	jl	.L18
	movl	$1, -32(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L19
.L20:
	movl	$0, %edi
	call	find
	movl	%eax, %ebx
	movl	-28(%rbp), %eax
	movl	%eax, %edi
	call	find
	cmpl	%eax, %ebx
	sete	%al
	movzbl	%al, %eax
	andl	%eax, -32(%rbp)
.L19:
	addl	$1, -28(%rbp)
	movl	n(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L20
	cmpl	$0, -32(%rbp)
	je	.L21
	leaq	.LC2(%rip), %rax
	jmp	.L22
.L21:
	leaq	.LC3(%rip), %rax
.L22:
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
