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

```c
/* Coached by Dukkha */
#include <stdio.h>

#define N 100000
#define M 200000
#define INF 0x3f3f3f3f

int oo[1 + M * 2], oj[1 + M * 2], ow[1 + M * 2];

int link(int o, int j, int w) {
	static int _ = 1;

	oo[_] = o, oj[_] = j, ow[_] = w;
	return _++;
}

int ae[N], xx[N];

int dfs(int p, int i, int x) {
	int o;

	if (xx[i])
		return xx[i] == x;
	xx[i] = x;
	for (o = ae[i]; o; o = oo[o]) {
		int j = oj[o], w = ow[o];

		if (j != p && !dfs(i, j, x + w))
			return 0;
	}
	return 1;
}

int main() {
	int n, m, i, j;

	scanf("%d%d", &n, &m);
	while (m--) {
		int w;

		scanf("%d%d%d", &i, &j, &w), i--, j--;
		ae[i] = link(ae[i], j, w);
		ae[j] = link(ae[j], i, -w);
	}
	for (i = 0; i < n; i++)
		if (xx[i] == 0 && !dfs(-1, i, INF)) {
			printf("No\n");
			return 0;
		}
	printf("Yes\n");
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	oo
	.bss
	.align 32
	.type	oo, @object
	.size	oo, 1600004
oo:
	.zero	1600004
	.globl	oj
	.align 32
	.type	oj, @object
	.size	oj, 1600004
oj:
	.zero	1600004
	.globl	ow
	.align 32
	.type	ow, @object
	.size	ow, 1600004
ow:
	.zero	1600004
	.text
	.globl	link
	.type	link, @function
link:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	_.0(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	oo(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	_.0(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	oj(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	_.0(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	ow(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	_.0(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, _.0(%rip)
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	link, .-link
	.globl	ae
	.bss
	.align 32
	.type	ae, @object
	.size	ae, 400000
ae:
	.zero	400000
	.globl	xx
	.align 32
	.type	xx, @object
	.size	xx, 400000
xx:
	.zero	400000
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.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	%edx, -28(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	xx(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L4
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	xx(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -28(%rbp)
	sete	%al
	movzbl	%al, %eax
	jmp	.L5
.L4:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	xx(%rip), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ae(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	jmp	.L6
.L8:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	oj(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ow(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	je	.L7
	movl	-28(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	-8(%rbp), %ecx
	movl	-24(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	dfs
	testl	%eax, %eax
	jne	.L7
	movl	$0, %eax
	jmp	.L5
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	oo(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
.L6:
	cmpl	$0, -12(%rbp)
	jne	.L8
	movl	$1, %eax
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"No"
.LC3:
	.string	"Yes"
	.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	$40, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L10
.L11:
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -36(%rbp)
	movl	-32(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -32(%rbp)
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	leaq	ae(%rip), %rax
	movl	(%rsi,%rax), %eax
	movl	-36(%rbp), %ebx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	link
	movslq	%ebx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	ae(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	negl	%eax
	movl	%eax, %edx
	movl	-36(%rbp), %ecx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	leaq	ae(%rip), %rax
	movl	(%rsi,%rax), %eax
	movl	-32(%rbp), %ebx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	link
	movslq	%ebx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	ae(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L10:
	movl	-40(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -40(%rbp)
	testl	%eax, %eax
	jne	.L11
	movl	$0, -36(%rbp)
	jmp	.L12
.L15:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	xx(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-36(%rbp), %eax
	movl	$1061109567, %edx
	movl	%eax, %esi
	movl	$-1, %edi
	call	dfs
	testl	%eax, %eax
	jne	.L13
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L16
.L13:
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -36(%rbp)
.L12:
	movl	-36(%rbp), %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L15
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L16:
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.data
	.align 4
	.type	_.0, @object
	.size	_.0, 4
_.0:
	.long	1
	.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
	.type	dfs.part.0, @function
dfs.part.0:
.LFB26:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%esi, %rax
	leaq	xx(%rip), %r11
	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	$88, %rsp
	.cfi_def_cfa_offset 144
	movl	%edx, (%r11,%rax,4)
	movl	%edi, 72(%rsp)
	leaq	ae(%rip), %rdi
	movslq	(%rdi,%rax,4), %rax
	movl	%esi, 56(%rsp)
	movl	%edx, 76(%rsp)
	testl	%eax, %eax
	je	.L2
	leaq	oj(%rip), %r13
	leaq	ow(%rip), %r14
	leaq	oo(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L20:
	movl	0(%r13,%rax,4), %edi
	movq	%rax, 48(%rsp)
	movl	(%r14,%rax,4), %eax
	movl	%edi, 32(%rsp)
	cmpl	72(%rsp), %edi
	je	.L3
	addl	76(%rsp), %eax
	movl	%eax, 60(%rsp)
	movslq	%edi, %rax
	movl	(%r11,%rax,4), %edx
	testl	%edx, %edx
	jne	.L49
	leaq	ae(%rip), %rcx
	movl	60(%rsp), %edi
	movl	(%rcx,%rax,4), %r9d
	movl	%edi, (%r11,%rax,4)
	testl	%r9d, %r9d
	je	.L3
	.p2align 4,,10
	.p2align 3
.L19:
	movslq	%r9d, %rax
	movq	%rax, 24(%rsp)
	movl	0(%r13,%rax,4), %r10d
	movl	(%r14,%rax,4), %eax
	cmpl	%r10d, 56(%rsp)
	je	.L6
	addl	60(%rsp), %eax
	movl	%eax, 36(%rsp)
	movslq	%r10d, %rax
	movl	(%r11,%rax,4), %edx
	testl	%edx, %edx
	jne	.L50
	leaq	ae(%rip), %rcx
	movl	36(%rsp), %edi
	movl	(%rcx,%rax,4), %ecx
	movl	%edi, (%r11,%rax,4)
	testl	%ecx, %ecx
	je	.L6
	movl	%r10d, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L18:
	movslq	%ecx, %r12
	movl	0(%r13,%r12,4), %r10d
	movl	(%r14,%r12,4), %ebp
	cmpl	%r10d, 32(%rsp)
	je	.L9
	movslq	%r10d, %rax
	addl	36(%rsp), %ebp
	movl	(%r11,%rax,4), %edx
	movl	%ebp, 20(%rsp)
	testl	%edx, %edx
	jne	.L51
	leaq	ae(%rip), %rsi
	movl	%ebp, (%r11,%rax,4)
	movl	(%rsi,%rax,4), %ecx
	testl	%ecx, %ecx
	je	.L9
	movq	%r12, 64(%rsp)
	movl	%r10d, %r12d
	.p2align 4,,10
	.p2align 3
.L17:
	movslq	%ecx, %rbp
	movl	0(%r13,%rbp,4), %edi
	movl	(%r14,%rbp,4), %r9d
	cmpl	%edi, 16(%rsp)
	je	.L11
	movl	20(%rsp), %eax
	leal	(%rax,%r9), %ebx
	movslq	%edi, %rax
	movl	(%r11,%rax,4), %edx
	testl	%edx, %edx
	jne	.L52
	leaq	ae(%rip), %rcx
	movl	%ebx, (%r11,%rax,4)
	movl	(%rcx,%rax,4), %r8d
	testl	%r8d, %r8d
	je	.L11
	movq	%rbp, 40(%rsp)
	movl	%edi, %ebp
	movl	%ebx, 12(%rsp)
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%ebp, %edi
	call	dfs.part.0
	leaq	xx(%rip), %r11
	testl	%eax, %eax
	je	.L8
.L16:
	movl	(%r15,%rbx,4), %r8d
	testl	%r8d, %r8d
	je	.L53
.L14:
	movslq	%r8d, %rbx
	movl	0(%r13,%rbx,4), %esi
	movl	(%r14,%rbx,4), %edx
	cmpl	%esi, %r12d
	je	.L16
	movslq	%esi, %rax
	addl	12(%rsp), %edx
	movl	(%r11,%rax,4), %eax
	testl	%eax, %eax
	je	.L15
	cmpl	%eax, %edx
	je	.L16
.L8:
	addq	$88, %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
.L52:
	.cfi_restore_state
	cmpl	%edx, %ebx
	jne	.L8
.L11:
	movl	(%r15,%rbp,4), %ecx
	testl	%ecx, %ecx
	jne	.L17
.L54:
	movq	64(%rsp), %r12
.L9:
	movl	(%r15,%r12,4), %ecx
	testl	%ecx, %ecx
	jne	.L18
.L6:
	movq	24(%rsp), %rax
	movl	(%r15,%rax,4), %r9d
	testl	%r9d, %r9d
	jne	.L19
.L3:
	movq	48(%rsp), %rax
	movslq	(%r15,%rax,4), %rax
	testl	%eax, %eax
	jne	.L20
.L2:
	addq	$88, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	$1, %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
.L53:
	.cfi_restore_state
	movq	40(%rsp), %rbp
	movl	(%r15,%rbp,4), %ecx
	testl	%ecx, %ecx
	jne	.L17
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L51:
	cmpl	%edx, %ebp
	je	.L9
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L50:
	cmpl	%edx, 36(%rsp)
	jne	.L8
	movq	24(%rsp), %rax
	movl	(%r15,%rax,4), %r9d
	testl	%r9d, %r9d
	jne	.L19
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L49:
	cmpl	%edx, 60(%rsp)
	jne	.L8
	movq	48(%rsp), %rax
	movslq	(%r15,%rax,4), %rax
	testl	%eax, %eax
	jne	.L20
	jmp	.L2
	.cfi_endproc
.LFE26:
	.size	dfs.part.0, .-dfs.part.0
	.p2align 4
	.globl	link
	.type	link, @function
link:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edx, %r8d
	movslq	_.0(%rip), %rdx
	leaq	oo(%rip), %rcx
	movl	%edi, (%rcx,%rdx,4)
	leaq	oj(%rip), %rcx
	movq	%rdx, %rax
	movl	%esi, (%rcx,%rdx,4)
	leaq	ow(%rip), %rcx
	movl	%r8d, (%rcx,%rdx,4)
	leal	1(%rdx), %edx
	movl	%edx, _.0(%rip)
	ret
	.cfi_endproc
.LFE23:
	.size	link, .-link
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%esi, %rax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	xx(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edx, %r12d
	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	0(%r13,%rax,4), %r8d
	testl	%r8d, %r8d
	jne	.L73
	movl	%edx, 0(%r13,%rax,4)
	leaq	ae(%rip), %rdx
	movslq	(%rdx,%rax,4), %rbx
	testl	%ebx, %ebx
	je	.L59
	movl	%edi, %ebp
	leaq	oj(%rip), %r15
	movq	%rax, %rdi
	leaq	ow(%rip), %r14
	leaq	oo(%rip), %rcx
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L62:
	movl	%r8d, 12(%rsp)
	movl	%edi, 8(%rsp)
	call	dfs.part.0
	movl	8(%rsp), %edi
	movl	12(%rsp), %r8d
	leaq	oo(%rip), %rcx
	testl	%eax, %eax
	je	.L56
.L63:
	movslq	(%rcx,%rbx,4), %rbx
	testl	%ebx, %ebx
	je	.L59
.L61:
	movl	(%r15,%rbx,4), %esi
	movl	(%r14,%rbx,4), %edx
	cmpl	%esi, %ebp
	je	.L63
	movslq	%esi, %rax
	addl	%r12d, %edx
	movl	0(%r13,%rax,4), %eax
	testl	%eax, %eax
	je	.L62
	cmpl	%eax, %edx
	je	.L63
.L56:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r8d, %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
.L59:
	.cfi_restore_state
	movl	$1, %r8d
	jmp	.L56
	.p2align 4,,10
	.p2align 3
.L73:
	cmpl	%edx, %r8d
	sete	%r8b
	movzbl	%r8b, %r8d
	jmp	.L56
	.cfi_endproc
.LFE24:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"Yes"
.LC3:
	.string	"No"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L78
	leaq	20(%rsp), %r15
	leaq	16(%rsp), %r14
	leaq	12(%rsp), %r12
	leaq	ae(%rip), %rbp
	leaq	oj(%rip), %rbx
	leaq	ow(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L75:
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r12, %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	movslq	_.0(%rip), %rdi
	leaq	oo(%rip), %r8
	leal	-1(%rax), %edx
	movl	16(%rsp), %eax
	leal	1(%rdi), %esi
	movslq	%edx, %r10
	movl	%edx, 12(%rsp)
	leal	-1(%rax), %ecx
	movd	0(%rbp,%r10,4), %xmm0
	movl	%edi, 0(%rbp,%r10,4)
	movslq	%esi, %r10
	movl	%ecx, (%rbx,%rdi,4)
	movq	%rdi, %rax
	movl	%ecx, 16(%rsp)
	movslq	%ecx, %rcx
	addl	$2, %eax
	movd	0(%rbp,%rcx,4), %xmm1
	movl	%eax, _.0(%rip)
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, (%r8,%rdi,4)
	movl	8(%rsp), %eax
	movd	20(%rsp), %xmm0
	movl	%edx, (%rbx,%r10,4)
	movl	20(%rsp), %edx
	negl	%edx
	movd	%edx, %xmm2
	leal	-1(%rax), %edx
	punpckldq	%xmm2, %xmm0
	movl	%edx, 8(%rsp)
	movq	%xmm0, 0(%r13,%rdi,4)
	movl	%esi, 0(%rbp,%rcx,4)
	testl	%eax, %eax
	jne	.L75
.L78:
	movl	4(%rsp), %edx
	xorl	%ebp, %ebp
	movl	$0, 12(%rsp)
	leaq	xx(%rip), %r14
	leaq	oj(%rip), %r15
	leaq	oo(%rip), %r12
	testl	%edx, %edx
	jg	.L76
	jmp	.L77
	.p2align 4,,10
	.p2align 3
.L80:
	addl	$1, %ebp
	movl	%ebp, 12(%rsp)
	cmpl	%edx, %ebp
	jge	.L77
.L76:
	movslq	%ebp, %rax
	movl	(%r14,%rax,4), %ecx
	testl	%ecx, %ecx
	jne	.L80
	leaq	ae(%rip), %rdi
	movl	$1061109567, (%r14,%rax,4)
	leaq	ow(%rip), %r13
	movslq	(%rdi,%rax,4), %rbx
	testl	%ebx, %ebx
	jne	.L81
	jmp	.L102
	.p2align 4,,10
	.p2align 3
.L84:
	movl	%ebp, %edi
	call	dfs.part.0
	testl	%eax, %eax
	je	.L85
.L86:
	movslq	(%r12,%rbx,4), %rbx
	testl	%ebx, %ebx
	je	.L103
.L81:
	movl	(%r15,%rbx,4), %esi
	movl	0(%r13,%rbx,4), %edx
	cmpl	$-1, %esi
	je	.L86
	movslq	%esi, %rax
	addl	$1061109567, %edx
	movl	(%r14,%rax,4), %eax
	testl	%eax, %eax
	je	.L84
	cmpl	%eax, %edx
	je	.L86
.L85:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
.L79:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L104
	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
.L103:
	.cfi_restore_state
	movl	12(%rsp), %ebp
	movl	4(%rsp), %edx
	addl	$1, %ebp
	movl	%ebp, 12(%rsp)
	cmpl	%edx, %ebp
	jl	.L76
	.p2align 4,,10
	.p2align 3
.L77:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L79
.L102:
	movl	12(%rsp), %ebp
	jmp	.L80
.L104:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.data
	.align 4
	.type	_.0, @object
	.size	_.0, 4
_.0:
	.long	1
	.globl	xx
	.bss
	.align 32
	.type	xx, @object
	.size	xx, 400000
xx:
	.zero	400000
	.globl	ae
	.align 32
	.type	ae, @object
	.size	ae, 400000
ae:
	.zero	400000
	.globl	ow
	.align 32
	.type	ow, @object
	.size	ow, 1600004
ow:
	.zero	1600004
	.globl	oj
	.align 32
	.type	oj, @object
	.size	oj, 1600004
oj:
	.zero	1600004
	.globl	oo
	.align 32
	.type	oo, @object
	.size	oo, 1600004
oo:
	.zero	1600004
	.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
	.type	dfs.part.0, @function
dfs.part.0:
.LFB26:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%esi, %rax
	leaq	xx(%rip), %r11
	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	$88, %rsp
	.cfi_def_cfa_offset 144
	movl	%edx, (%r11,%rax,4)
	movl	%edi, 72(%rsp)
	leaq	ae(%rip), %rdi
	movslq	(%rdi,%rax,4), %rax
	movl	%esi, 56(%rsp)
	movl	%edx, 76(%rsp)
	testl	%eax, %eax
	je	.L2
	leaq	oj(%rip), %r13
	leaq	ow(%rip), %r14
	leaq	oo(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L20:
	movl	0(%r13,%rax,4), %edi
	movq	%rax, 48(%rsp)
	movl	(%r14,%rax,4), %eax
	movl	%edi, 32(%rsp)
	cmpl	72(%rsp), %edi
	je	.L3
	addl	76(%rsp), %eax
	movl	%eax, 60(%rsp)
	movslq	%edi, %rax
	movl	(%r11,%rax,4), %edx
	testl	%edx, %edx
	jne	.L49
	leaq	ae(%rip), %rcx
	movl	60(%rsp), %edi
	movl	(%rcx,%rax,4), %r9d
	movl	%edi, (%r11,%rax,4)
	testl	%r9d, %r9d
	je	.L3
	.p2align 4,,10
	.p2align 3
.L19:
	movslq	%r9d, %rax
	movq	%rax, 24(%rsp)
	movl	0(%r13,%rax,4), %r10d
	movl	(%r14,%rax,4), %eax
	cmpl	%r10d, 56(%rsp)
	je	.L6
	addl	60(%rsp), %eax
	movl	%eax, 36(%rsp)
	movslq	%r10d, %rax
	movl	(%r11,%rax,4), %edx
	testl	%edx, %edx
	jne	.L50
	leaq	ae(%rip), %rcx
	movl	36(%rsp), %edi
	movl	(%rcx,%rax,4), %ecx
	movl	%edi, (%r11,%rax,4)
	testl	%ecx, %ecx
	je	.L6
	movl	%r10d, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L18:
	movslq	%ecx, %r12
	movl	0(%r13,%r12,4), %r10d
	movl	(%r14,%r12,4), %ebp
	cmpl	%r10d, 32(%rsp)
	je	.L9
	movslq	%r10d, %rax
	addl	36(%rsp), %ebp
	movl	(%r11,%rax,4), %edx
	movl	%ebp, 20(%rsp)
	testl	%edx, %edx
	jne	.L51
	leaq	ae(%rip), %rsi
	movl	%ebp, (%r11,%rax,4)
	movl	(%rsi,%rax,4), %ecx
	testl	%ecx, %ecx
	je	.L9
	movq	%r12, 64(%rsp)
	movl	%r10d, %r12d
	.p2align 4,,10
	.p2align 3
.L17:
	movslq	%ecx, %rbp
	movl	0(%r13,%rbp,4), %edi
	movl	(%r14,%rbp,4), %r9d
	cmpl	%edi, 16(%rsp)
	je	.L11
	movl	20(%rsp), %eax
	leal	(%rax,%r9), %ebx
	movslq	%edi, %rax
	movl	(%r11,%rax,4), %edx
	testl	%edx, %edx
	jne	.L52
	leaq	ae(%rip), %rcx
	movl	%ebx, (%r11,%rax,4)
	movl	(%rcx,%rax,4), %r8d
	testl	%r8d, %r8d
	je	.L11
	movq	%rbp, 40(%rsp)
	movl	%edi, %ebp
	movl	%ebx, 12(%rsp)
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%ebp, %edi
	call	dfs.part.0
	leaq	xx(%rip), %r11
	testl	%eax, %eax
	je	.L8
.L16:
	movl	(%r15,%rbx,4), %r8d
	testl	%r8d, %r8d
	je	.L53
.L14:
	movslq	%r8d, %rbx
	movl	0(%r13,%rbx,4), %esi
	movl	(%r14,%rbx,4), %edx
	cmpl	%esi, %r12d
	je	.L16
	movslq	%esi, %rax
	addl	12(%rsp), %edx
	movl	(%r11,%rax,4), %eax
	testl	%eax, %eax
	je	.L15
	cmpl	%eax, %edx
	je	.L16
.L8:
	addq	$88, %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
.L52:
	.cfi_restore_state
	cmpl	%edx, %ebx
	jne	.L8
.L11:
	movl	(%r15,%rbp,4), %ecx
	testl	%ecx, %ecx
	jne	.L17
.L54:
	movq	64(%rsp), %r12
.L9:
	movl	(%r15,%r12,4), %ecx
	testl	%ecx, %ecx
	jne	.L18
.L6:
	movq	24(%rsp), %rax
	movl	(%r15,%rax,4), %r9d
	testl	%r9d, %r9d
	jne	.L19
.L3:
	movq	48(%rsp), %rax
	movslq	(%r15,%rax,4), %rax
	testl	%eax, %eax
	jne	.L20
.L2:
	addq	$88, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	$1, %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
.L53:
	.cfi_restore_state
	movq	40(%rsp), %rbp
	movl	(%r15,%rbp,4), %ecx
	testl	%ecx, %ecx
	jne	.L17
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L51:
	cmpl	%edx, %ebp
	je	.L9
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L50:
	cmpl	%edx, 36(%rsp)
	jne	.L8
	movq	24(%rsp), %rax
	movl	(%r15,%rax,4), %r9d
	testl	%r9d, %r9d
	jne	.L19
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L49:
	cmpl	%edx, 60(%rsp)
	jne	.L8
	movq	48(%rsp), %rax
	movslq	(%r15,%rax,4), %rax
	testl	%eax, %eax
	jne	.L20
	jmp	.L2
	.cfi_endproc
.LFE26:
	.size	dfs.part.0, .-dfs.part.0
	.p2align 4
	.globl	link
	.type	link, @function
link:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edx, %r8d
	movslq	_.0(%rip), %rdx
	leaq	oo(%rip), %rcx
	movl	%edi, (%rcx,%rdx,4)
	leaq	oj(%rip), %rcx
	movq	%rdx, %rax
	movl	%esi, (%rcx,%rdx,4)
	leaq	ow(%rip), %rcx
	movl	%r8d, (%rcx,%rdx,4)
	leal	1(%rdx), %edx
	movl	%edx, _.0(%rip)
	ret
	.cfi_endproc
.LFE23:
	.size	link, .-link
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%esi, %rax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	xx(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edx, %r12d
	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	0(%r13,%rax,4), %r8d
	testl	%r8d, %r8d
	jne	.L73
	movl	%edx, 0(%r13,%rax,4)
	leaq	ae(%rip), %rdx
	movslq	(%rdx,%rax,4), %rbx
	testl	%ebx, %ebx
	je	.L59
	movl	%edi, %ebp
	leaq	oj(%rip), %r15
	movq	%rax, %rdi
	leaq	ow(%rip), %r14
	leaq	oo(%rip), %rcx
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L62:
	movl	%r8d, 12(%rsp)
	movl	%edi, 8(%rsp)
	call	dfs.part.0
	movl	8(%rsp), %edi
	movl	12(%rsp), %r8d
	leaq	oo(%rip), %rcx
	testl	%eax, %eax
	je	.L56
.L63:
	movslq	(%rcx,%rbx,4), %rbx
	testl	%ebx, %ebx
	je	.L59
.L61:
	movl	(%r15,%rbx,4), %esi
	movl	(%r14,%rbx,4), %edx
	cmpl	%esi, %ebp
	je	.L63
	movslq	%esi, %rax
	addl	%r12d, %edx
	movl	0(%r13,%rax,4), %eax
	testl	%eax, %eax
	je	.L62
	cmpl	%eax, %edx
	je	.L63
.L56:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r8d, %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
.L59:
	.cfi_restore_state
	movl	$1, %r8d
	jmp	.L56
	.p2align 4,,10
	.p2align 3
.L73:
	cmpl	%edx, %r8d
	sete	%r8b
	movzbl	%r8b, %r8d
	jmp	.L56
	.cfi_endproc
.LFE24:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"Yes"
.LC3:
	.string	"No"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L78
	leaq	20(%rsp), %r15
	leaq	16(%rsp), %r14
	leaq	12(%rsp), %r12
	leaq	ae(%rip), %rbp
	leaq	oj(%rip), %rbx
	leaq	ow(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L75:
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r12, %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	movslq	_.0(%rip), %rdi
	leaq	oo(%rip), %r8
	leal	-1(%rax), %edx
	movl	16(%rsp), %eax
	leal	1(%rdi), %esi
	movslq	%edx, %r10
	movl	%edx, 12(%rsp)
	leal	-1(%rax), %ecx
	movd	0(%rbp,%r10,4), %xmm0
	movl	%edi, 0(%rbp,%r10,4)
	movslq	%esi, %r10
	movl	%ecx, (%rbx,%rdi,4)
	movq	%rdi, %rax
	movl	%ecx, 16(%rsp)
	movslq	%ecx, %rcx
	addl	$2, %eax
	movd	0(%rbp,%rcx,4), %xmm1
	movl	%eax, _.0(%rip)
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, (%r8,%rdi,4)
	movl	8(%rsp), %eax
	movd	20(%rsp), %xmm0
	movl	%edx, (%rbx,%r10,4)
	movl	20(%rsp), %edx
	negl	%edx
	movd	%edx, %xmm2
	leal	-1(%rax), %edx
	punpckldq	%xmm2, %xmm0
	movl	%edx, 8(%rsp)
	movq	%xmm0, 0(%r13,%rdi,4)
	movl	%esi, 0(%rbp,%rcx,4)
	testl	%eax, %eax
	jne	.L75
.L78:
	movl	4(%rsp), %edx
	xorl	%ebp, %ebp
	movl	$0, 12(%rsp)
	leaq	xx(%rip), %r14
	leaq	oj(%rip), %r15
	leaq	oo(%rip), %r12
	testl	%edx, %edx
	jg	.L76
	jmp	.L77
	.p2align 4,,10
	.p2align 3
.L80:
	addl	$1, %ebp
	movl	%ebp, 12(%rsp)
	cmpl	%edx, %ebp
	jge	.L77
.L76:
	movslq	%ebp, %rax
	movl	(%r14,%rax,4), %ecx
	testl	%ecx, %ecx
	jne	.L80
	leaq	ae(%rip), %rdi
	movl	$1061109567, (%r14,%rax,4)
	leaq	ow(%rip), %r13
	movslq	(%rdi,%rax,4), %rbx
	testl	%ebx, %ebx
	jne	.L81
	jmp	.L102
	.p2align 4,,10
	.p2align 3
.L84:
	movl	%ebp, %edi
	call	dfs.part.0
	testl	%eax, %eax
	je	.L85
.L86:
	movslq	(%r12,%rbx,4), %rbx
	testl	%ebx, %ebx
	je	.L103
.L81:
	movl	(%r15,%rbx,4), %esi
	movl	0(%r13,%rbx,4), %edx
	cmpl	$-1, %esi
	je	.L86
	movslq	%esi, %rax
	addl	$1061109567, %edx
	movl	(%r14,%rax,4), %eax
	testl	%eax, %eax
	je	.L84
	cmpl	%eax, %edx
	je	.L86
.L85:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
.L79:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L104
	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
.L103:
	.cfi_restore_state
	movl	12(%rsp), %ebp
	movl	4(%rsp), %edx
	addl	$1, %ebp
	movl	%ebp, 12(%rsp)
	cmpl	%edx, %ebp
	jl	.L76
	.p2align 4,,10
	.p2align 3
.L77:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L79
.L102:
	movl	12(%rsp), %ebp
	jmp	.L80
.L104:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.data
	.align 4
	.type	_.0, @object
	.size	_.0, 4
_.0:
	.long	1
	.globl	xx
	.bss
	.align 32
	.type	xx, @object
	.size	xx, 400000
xx:
	.zero	400000
	.globl	ae
	.align 32
	.type	ae, @object
	.size	ae, 400000
ae:
	.zero	400000
	.globl	ow
	.align 32
	.type	ow, @object
	.size	ow, 1600004
ow:
	.zero	1600004
	.globl	oj
	.align 32
	.type	oj, @object
	.size	oj, 1600004
oj:
	.zero	1600004
	.globl	oo
	.align 32
	.type	oo, @object
	.size	oo, 1600004
oo:
	.zero	1600004
	.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:

/* Coached by Dukkha */
#include <stdio.h>

#define N 100000
#define M 200000
#define INF 0x3f3f3f3f

int oo[1 + M * 2], oj[1 + M * 2], ow[1 + M * 2];

int link(int o, int j, int w) {
	static int _ = 1;

	oo[_] = o, oj[_] = j, ow[_] = w;
	return _++;
}

int ae[N], xx[N];

int dfs(int p, int i, int x) {
	int o;

	if (xx[i])
		return xx[i] == x;
	xx[i] = x;
	for (o = ae[i]; o; o = oo[o]) {
		int j = oj[o], w = ow[o];

		if (j != p && !dfs(i, j, x + w))
			return 0;
	}
	return 1;
}

int main() {
	int n, m, i, j;

	scanf("%d%d", &n, &m);
	while (m--) {
		int w;

		scanf("%d%d%d", &i, &j, &w), i--, j--;
		ae[i] = link(ae[i], j, w);
		ae[j] = link(ae[j], i, -w);
	}
	for (i = 0; i < n; i++)
		if (xx[i] == 0 && !dfs(-1, i, INF)) {
			printf("No\n");
			return 0;
		}
	printf("Yes\n");
	return 0;
}

3 3
1 2 1
2 3 1
1 3 2

Yes

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

```c
/* Coached by Dukkha */
#include <stdio.h>

#define N 100000
#define M 200000
#define INF 0x3f3f3f3f

int oo[1 + M * 2], oj[1 + M * 2], ow[1 + M * 2];

int link(int o, int j, int w) {
	static int _ = 1;

	oo[_] = o, oj[_] = j, ow[_] = w;
	return _++;
}

int ae[N], xx[N];

int dfs(int p, int i, int x) {
	int o;

	if (xx[i])
		return xx[i] == x;
	xx[i] = x;
	for (o = ae[i]; o; o = oo[o]) {
		int j = oj[o], w = ow[o];

		if (j != p && !dfs(i, j, x + w))
			return 0;
	}
	return 1;
}

int main() {
	int n, m, i, j;

	scanf("%d%d", &n, &m);
	while (m--) {
		int w;

		scanf("%d%d%d", &i, &j, &w), i--, j--;
		ae[i] = link(ae[i], j, w);
		ae[j] = link(ae[j], i, -w);
	}
	for (i = 0; i < n; i++)
		if (xx[i] == 0 && !dfs(-1, i, INF)) {
			printf("No\n");
			return 0;
		}
	printf("Yes\n");
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	oo
	.bss
	.align 32
	.type	oo, @object
	.size	oo, 1600004
oo:
	.zero	1600004
	.globl	oj
	.align 32
	.type	oj, @object
	.size	oj, 1600004
oj:
	.zero	1600004
	.globl	ow
	.align 32
	.type	ow, @object
	.size	ow, 1600004
ow:
	.zero	1600004
	.text
	.globl	link
	.type	link, @function
link:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	_.0(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	oo(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	_.0(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	oj(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	_.0(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	ow(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	_.0(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, _.0(%rip)
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	link, .-link
	.globl	ae
	.bss
	.align 32
	.type	ae, @object
	.size	ae, 400000
ae:
	.zero	400000
	.globl	xx
	.align 32
	.type	xx, @object
	.size	xx, 400000
xx:
	.zero	400000
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.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	%edx, -28(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	xx(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L4
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	xx(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -28(%rbp)
	sete	%al
	movzbl	%al, %eax
	jmp	.L5
.L4:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	xx(%rip), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ae(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	jmp	.L6
.L8:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	oj(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ow(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	je	.L7
	movl	-28(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	-8(%rbp), %ecx
	movl	-24(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	dfs
	testl	%eax, %eax
	jne	.L7
	movl	$0, %eax
	jmp	.L5
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	oo(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
.L6:
	cmpl	$0, -12(%rbp)
	jne	.L8
	movl	$1, %eax
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"No"
.LC3:
	.string	"Yes"
	.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	$40, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L10
.L11:
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -36(%rbp)
	movl	-32(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -32(%rbp)
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	leaq	ae(%rip), %rax
	movl	(%rsi,%rax), %eax
	movl	-36(%rbp), %ebx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	link
	movslq	%ebx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	ae(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	negl	%eax
	movl	%eax, %edx
	movl	-36(%rbp), %ecx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	leaq	ae(%rip), %rax
	movl	(%rsi,%rax), %eax
	movl	-32(%rbp), %ebx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	link
	movslq	%ebx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	ae(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L10:
	movl	-40(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -40(%rbp)
	testl	%eax, %eax
	jne	.L11
	movl	$0, -36(%rbp)
	jmp	.L12
.L15:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	xx(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-36(%rbp), %eax
	movl	$1061109567, %edx
	movl	%eax, %esi
	movl	$-1, %edi
	call	dfs
	testl	%eax, %eax
	jne	.L13
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L16
.L13:
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -36(%rbp)
.L12:
	movl	-36(%rbp), %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L15
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L16:
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.data
	.align 4
	.type	_.0, @object
	.size	_.0, 4
_.0:
	.long	1
	.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	oo
	.bss
	.align 32
	.type	oo, @object
	.size	oo, 1600004
oo:
	.zero	1600004
	.globl	oj
	.align 32
	.type	oj, @object
	.size	oj, 1600004
oj:
	.zero	1600004
	.globl	ow
	.align 32
	.type	ow, @object
	.size	ow, 1600004
ow:
	.zero	1600004
	.text
	.globl	link
	.type	link, @function
link:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	_.0(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	oo(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	_.0(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	oj(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	_.0(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	ow(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	_.0(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, _.0(%rip)
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	link, .-link
	.globl	ae
	.bss
	.align 32
	.type	ae, @object
	.size	ae, 400000
ae:
	.zero	400000
	.globl	xx
	.align 32
	.type	xx, @object
	.size	xx, 400000
xx:
	.zero	400000
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.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	%edx, -28(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	xx(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L4
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	xx(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -28(%rbp)
	sete	%al
	movzbl	%al, %eax
	jmp	.L5
.L4:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	xx(%rip), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ae(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	jmp	.L6
.L8:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	oj(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ow(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	je	.L7
	movl	-28(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	-8(%rbp), %ecx
	movl	-24(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	dfs
	testl	%eax, %eax
	jne	.L7
	movl	$0, %eax
	jmp	.L5
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	oo(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
.L6:
	cmpl	$0, -12(%rbp)
	jne	.L8
	movl	$1, %eax
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"No"
.LC3:
	.string	"Yes"
	.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	$40, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L10
.L11:
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -36(%rbp)
	movl	-32(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -32(%rbp)
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	leaq	ae(%rip), %rax
	movl	(%rsi,%rax), %eax
	movl	-36(%rbp), %ebx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	link
	movslq	%ebx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	ae(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	negl	%eax
	movl	%eax, %edx
	movl	-36(%rbp), %ecx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	leaq	ae(%rip), %rax
	movl	(%rsi,%rax), %eax
	movl	-32(%rbp), %ebx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	link
	movslq	%ebx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	ae(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L10:
	movl	-40(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -40(%rbp)
	testl	%eax, %eax
	jne	.L11
	movl	$0, -36(%rbp)
	jmp	.L12
.L15:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	xx(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-36(%rbp), %eax
	movl	$1061109567, %edx
	movl	%eax, %esi
	movl	$-1, %edi
	call	dfs
	testl	%eax, %eax
	jne	.L13
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L16
.L13:
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -36(%rbp)
.L12:
	movl	-36(%rbp), %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L15
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L16:
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.data
	.align 4
	.type	_.0, @object
	.size	_.0, 4
_.0:
	.long	1
	.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:
