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

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#define min(a, b) a < b ? a : b
#define max(a, b) a > b ? a : b

#define MAXN 100000

int main(void)
{
	long long i;
	long long N;
	int ok = 1;
	long long sumn = 0, suma = 0, k;
	long long A[MAXN];
	long long d[MAXN];

	scanf("%lld", &N);

	for (i = 0; i < N; i++) {
		scanf("%lld", &A[i]);
		suma += A[i];
	}

	sumn = N * (N + 1) / 2;
	if ((suma % sumn) != 0) {
		printf("NO\n");
	} else {
		k = suma / sumn;
		for (i = 0; i < N; i++) {
			d[i] = A[(i + 1) % N] - A[i] - k;
		}
		for (i = 0; i < N; i++) {
			if (d[i] % N == 0 && d[i] <= 0) {
				//ok = 1;
			} else {
				ok = 0;
				break;
			}
			/*if (d[i] % N != 0 || d[i] > 0) {
				ok = 0;
				break;
			}*/
		}
		//printf("YES\n");
		if (ok) {
			printf("YES\n");
		} else {
			printf("NO\n");
		}
	}
	/*if (ok) {
		printf("YES\n");
	} else {
		printf("NO\n");
	}*/
	return (0);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"NO"
.LC2:
	.string	"YES"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2600, %rsp
	.cfi_def_cfa_offset 1600080
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1600024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L2
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
	leaq	16(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	(%r12,%rbx,8), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rcx
	addq	(%r12,%rbx,8), %rbp
	addq	$1, %rbx
	cmpq	%rbx, %rcx
	jg	.L3
	leaq	1(%rcx), %rax
	imulq	%rcx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rax, %rdx
	movq	%rbp, %rax
	movq	%rdx, %rbx
	cqto
	sarq	%rbx
	idivq	%rbx
	movq	%rdx, %rsi
	movq	%rax, %rbp
	testq	%rdx, %rdx
	jne	.L7
	testq	%rcx, %rcx
	jle	.L2
	leaq	800016(%rsp), %rdi
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$1, %rsi
	movq	%rsi, %rax
	cqto
	idivq	%rcx
	movq	16(%rsp,%rdx,8), %rdx
	subq	-8(%r12,%rsi,8), %rdx
	subq	%rbp, %rdx
	movq	%rdx, -8(%rdi,%rsi,8)
	cmpq	%rsi, %rcx
	jne	.L6
	movq	%rdi, %rsi
	leaq	(%rdi,%rcx,8), %r8
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L22:
	testq	%rdi, %rdi
	jg	.L7
	addq	$8, %rsi
	cmpq	%rsi, %r8
	je	.L2
.L8:
	movq	(%rsi), %rdi
	movq	%rdi, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	je	.L22
.L7:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L5:
	movq	1600024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$1600040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L5
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"NO"
.LC2:
	.string	"YES"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2600, %rsp
	.cfi_def_cfa_offset 1600080
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1600024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L2
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
	leaq	16(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	(%r12,%rbx,8), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rcx
	addq	(%r12,%rbx,8), %rbp
	addq	$1, %rbx
	cmpq	%rbx, %rcx
	jg	.L3
	leaq	1(%rcx), %rax
	imulq	%rcx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rax, %rdx
	movq	%rbp, %rax
	movq	%rdx, %rbx
	cqto
	sarq	%rbx
	idivq	%rbx
	movq	%rdx, %rsi
	movq	%rax, %rbp
	testq	%rdx, %rdx
	jne	.L7
	testq	%rcx, %rcx
	jle	.L2
	leaq	800016(%rsp), %rdi
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$1, %rsi
	movq	%rsi, %rax
	cqto
	idivq	%rcx
	movq	16(%rsp,%rdx,8), %rdx
	subq	-8(%r12,%rsi,8), %rdx
	subq	%rbp, %rdx
	movq	%rdx, -8(%rdi,%rsi,8)
	cmpq	%rsi, %rcx
	jne	.L6
	movq	%rdi, %rsi
	leaq	(%rdi,%rcx,8), %r8
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L22:
	testq	%rdi, %rdi
	jg	.L7
	addq	$8, %rsi
	cmpq	%rsi, %r8
	je	.L2
.L8:
	movq	(%rsi), %rdi
	movq	%rdi, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	je	.L22
.L7:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L5:
	movq	1600024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$1600040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L5
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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:
```
rule
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"NO"
.LC2:
	.string	"YES"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2600, %rsp
	.cfi_def_cfa_offset 1600080
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1600024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L2
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
	leaq	16(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	(%r12,%rbx,8), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rcx
	addq	(%r12,%rbx,8), %rbp
	addq	$1, %rbx
	cmpq	%rbx, %rcx
	jg	.L3
	leaq	1(%rcx), %rax
	imulq	%rcx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rax, %rdx
	movq	%rbp, %rax
	movq	%rdx, %rbx
	cqto
	sarq	%rbx
	idivq	%rbx
	movq	%rdx, %rsi
	movq	%rax, %rbp
	testq	%rdx, %rdx
	jne	.L7
	testq	%rcx, %rcx
	jle	.L2
	leaq	800016(%rsp), %rdi
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$1, %rsi
	movq	%rsi, %rax
	cqto
	idivq	%rcx
	movq	16(%rsp,%rdx,8), %rdx
	subq	-8(%r12,%rsi,8), %rdx
	subq	%rbp, %rdx
	movq	%rdx, -8(%rdi,%rsi,8)
	cmpq	%rsi, %rcx
	jne	.L6
	movq	%rdi, %rsi
	leaq	(%rdi,%rcx,8), %r8
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L22:
	testq	%rdi, %rdi
	jg	.L7
	addq	$8, %rsi
	cmpq	%rsi, %r8
	je	.L2
.L8:
	movq	(%rsi), %rdi
	movq	%rdi, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	je	.L22
.L7:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L5:
	movq	1600024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$1600040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L5
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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:
```
```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#define min(a, b) a < b ? a : b
#define max(a, b) a > b ? a : b

#define MAXN 100000

int main(void)
{
	long long i;
	long long N;
	int ok = 1;
	long long sumn = 0, suma = 0, k;
	long long A[MAXN];
	long long d[MAXN];

	scanf("%lld", &N);

	for (i = 0; i < N; i++) {
		scanf("%lld", &A[i]);
		suma += A[i];
	}

	sumn = N * (N + 1) / 2;
	if ((suma % sumn) != 0) {
		printf("NO\n");
	} else {
		k = suma / sumn;
		for (i = 0; i < N; i++) {
			d[i] = A[(i + 1) % N] - A[i] - k;
		}
		for (i = 0; i < N; i++) {
			if (d[i] % N == 0 && d[i] <= 0) {
				//ok = 1;
			} else {
				ok = 0;
				break;
			}
			/*if (d[i] % N != 0 || d[i] > 0) {
				ok = 0;
				break;
			}*/
		}
		//printf("YES\n");
		if (ok) {
			printf("YES\n");
		} else {
			printf("NO\n");
		}
	}
	/*if (ok) {
		printf("YES\n");
	} else {
		printf("NO\n");
	}*/
	return (0);
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#define min(a, b) a < b ? a : b
#define max(a, b) a > b ? a : b

#define MAXN 100000

int main(void)
{
	long long i;
	long long N;
	int ok = 1;
	long long sumn = 0, suma = 0, k;
	long long A[MAXN];
	long long d[MAXN];

	scanf("%lld", &N);

	for (i = 0; i < N; i++) {
		scanf("%lld", &A[i]);
		suma += A[i];
	}

	sumn = N * (N + 1) / 2;
	if ((suma % sumn) != 0) {
		printf("NO\n");
	} else {
		k = suma / sumn;
		for (i = 0; i < N; i++) {
			d[i] = A[(i + 1) % N] - A[i] - k;
		}
		for (i = 0; i < N; i++) {
			if (d[i] % N == 0 && d[i] <= 0) {
				//ok = 1;
			} else {
				ok = 0;
				break;
			}
			/*if (d[i] % N != 0 || d[i] > 0) {
				ok = 0;
				break;
			}*/
		}
		//printf("YES\n");
		if (ok) {
			printf("YES\n");
		} else {
			printf("NO\n");
		}
	}
	/*if (ok) {
		printf("YES\n");
	} else {
		printf("NO\n");
	}*/
	return (0);
}```

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.
Optimized Assembly Code:

4
2 2 3 1
 5
6 11 12 10 8
 5
4 5 2 2 3
 4
2 2 3 2
 5
6 16 12 10 8
 5
4 5 3 2 3
 4
2 1 3 2
 5
6 26 12 10 8
 5
5 5 3 2 3
 4
4 1 3 2

NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO

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

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#define min(a, b) a < b ? a : b
#define max(a, b) a > b ? a : b

#define MAXN 100000

int main(void)
{
	long long i;
	long long N;
	int ok = 1;
	long long sumn = 0, suma = 0, k;
	long long A[MAXN];
	long long d[MAXN];

	scanf("%lld", &N);

	for (i = 0; i < N; i++) {
		scanf("%lld", &A[i]);
		suma += A[i];
	}

	sumn = N * (N + 1) / 2;
	if ((suma % sumn) != 0) {
		printf("NO\n");
	} else {
		k = suma / sumn;
		for (i = 0; i < N; i++) {
			d[i] = A[(i + 1) % N] - A[i] - k;
		}
		for (i = 0; i < N; i++) {
			if (d[i] % N == 0 && d[i] <= 0) {
				//ok = 1;
			} else {
				ok = 0;
				break;
			}
			/*if (d[i] % N != 0 || d[i] > 0) {
				ok = 0;
				break;
			}*/
		}
		//printf("YES\n");
		if (ok) {
			printf("YES\n");
		} else {
			printf("NO\n");
		}
	}
	/*if (ok) {
		printf("YES\n");
	} else {
		printf("NO\n");
	}*/
	return (0);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"NO"
.LC2:
	.string	"YES"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2600, %rsp
	.cfi_def_cfa_offset 1600080
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1600024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L2
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
	leaq	16(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	(%r12,%rbx,8), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rcx
	addq	(%r12,%rbx,8), %rbp
	addq	$1, %rbx
	cmpq	%rbx, %rcx
	jg	.L3
	leaq	1(%rcx), %rax
	imulq	%rcx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rax, %rdx
	movq	%rbp, %rax
	movq	%rdx, %rbx
	cqto
	sarq	%rbx
	idivq	%rbx
	movq	%rdx, %rsi
	movq	%rax, %rbp
	testq	%rdx, %rdx
	jne	.L7
	testq	%rcx, %rcx
	jle	.L2
	leaq	800016(%rsp), %rdi
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$1, %rsi
	movq	%rsi, %rax
	cqto
	idivq	%rcx
	movq	16(%rsp,%rdx,8), %rdx
	subq	-8(%r12,%rsi,8), %rdx
	subq	%rbp, %rdx
	movq	%rdx, -8(%rdi,%rsi,8)
	cmpq	%rsi, %rcx
	jne	.L6
	movq	%rdi, %rsi
	leaq	(%rdi,%rcx,8), %r8
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L22:
	testq	%rdi, %rdi
	jg	.L7
	addq	$8, %rsi
	cmpq	%rsi, %r8
	je	.L2
.L8:
	movq	(%rsi), %rdi
	movq	%rdi, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	je	.L22
.L7:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L5:
	movq	1600024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$1600040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L5
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"NO"
.LC2:
	.string	"YES"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2600, %rsp
	.cfi_def_cfa_offset 1600080
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1600024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L2
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
	leaq	16(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	(%r12,%rbx,8), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rcx
	addq	(%r12,%rbx,8), %rbp
	addq	$1, %rbx
	cmpq	%rbx, %rcx
	jg	.L3
	leaq	1(%rcx), %rax
	imulq	%rcx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rax, %rdx
	movq	%rbp, %rax
	movq	%rdx, %rbx
	cqto
	sarq	%rbx
	idivq	%rbx
	movq	%rdx, %rsi
	movq	%rax, %rbp
	testq	%rdx, %rdx
	jne	.L7
	testq	%rcx, %rcx
	jle	.L2
	leaq	800016(%rsp), %rdi
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$1, %rsi
	movq	%rsi, %rax
	cqto
	idivq	%rcx
	movq	16(%rsp,%rdx,8), %rdx
	subq	-8(%r12,%rsi,8), %rdx
	subq	%rbp, %rdx
	movq	%rdx, -8(%rdi,%rsi,8)
	cmpq	%rsi, %rcx
	jne	.L6
	movq	%rdi, %rsi
	leaq	(%rdi,%rcx,8), %r8
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L22:
	testq	%rdi, %rdi
	jg	.L7
	addq	$8, %rsi
	cmpq	%rsi, %r8
	je	.L2
.L8:
	movq	(%rsi), %rdi
	movq	%rdi, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	je	.L22
.L7:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L5:
	movq	1600024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$1600040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L5
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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:
```