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

```c
#include <stdio.h>
#include <stdlib.h>
#define int long long
#define p (int)(1e9 + 7)

int MOD(int a){
	a %= p;
	return a >= 0 ? a : a + p;
}

int power(int a, int N){
	if(N == 0){
		return 1;
	}
	else if(N % 2 == 0){
		return power(MOD(a * a), N / 2);
	}
	else{
		return MOD(a * power(a, N - 1));
	}
}

signed main(){
	int M = ((int)1 << 20);
	int N, i, x;
	scanf("%lld", &N);
	int *a = (int *)malloc(sizeof(int) * (N + 1));
	int *s = (int *)malloc(sizeof(int) * (N + 1));
	s[0] = 0;
	int *Onum = (int *)malloc(sizeof(int) * (N + 1));
	Onum[0] = 0;
	for(i = 1; i <= N; i++){
		scanf("%lld", &a[i]);
		s[i] = (s[i - 1] ^ a[i]);
		Onum[i] = Onum[i - 1] + (s[i] == 0 ? 1 : 0);
	}
/*	printf("s:\n");
	for(i = 0; i <= N; i++){
		printf("%lld ", s[i]);
	}
	printf("\n");
	printf("Onum:\n");
	for(i = 0; i <= N; i++){
		printf("%lld ", Onum[i]);
	}
	printf("\n");
*/	int *prev = (int *)malloc(sizeof(int) * M);
	for(i = 0; i < M; i++){
		prev[i] = 0;
	}
	int *dp = (int *)malloc(sizeof(int) * M);
	for(i = 0; i < M; i++){
		dp[i] = 0;
	}
	int *sum = (int *)malloc(sizeof(int) * M);
	for(i = 0; i < M; i++){
		sum[i] = 0;
	}
	int *Osum = (int *)malloc(sizeof(int) * M);
	for(i = 0; i < M; i++){
		Osum[i] = 1;
	}
	for(i = 1; i <= N; i++){
		x = s[i];
		dp[x] = MOD(sum[x] * (Onum[i] - Onum[prev[x]]) + Osum[x]);
		Osum[x] = MOD(Osum[x] + sum[x] * (Onum[i] - Onum[prev[x]]));
		sum[x] = MOD(sum[x] + dp[x]);
/*		if(prev[x] == -1){
			dp[x] = 1;
			sum[x] = 1;
		}
		else{
			dp[x] = MOD(sum[x] * (Onum[i] - Onum[prev[x]]) + 1);
			sum[x] = MOD(sum[x] + dp[x]);
		}
*/		prev[x] = i;
//		printf("i = %lld\n", i);
//		printf("dp[%lld] = %lld\n", x, dp[x]);
//		printf("sum[%lld] = %lld\n", x, sum[x]);
	}
	int ans = 0;
	if(s[N] == 0){
		ans = power(2, Onum[N] - 1);
		for(i = 1; i < M; i++){
			ans = MOD(ans + sum[i]);
		}
	}
	else{
		ans = dp[s[N]];
	}
/*	for(i = 1; i < M; i++){
		if(s[N] == 0){
			ans = MOD(ans + sum[i]);
		}
		else if(s[N] == i){
			ans = MOD(ans + dp[i]);
		}
	}
	if(s[N] == 0){
		ans = MOD(ans + power(2, Onum[N] - 1));
	}
*/	printf("%lld\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	MOD
	.type	MOD, @function
MOD:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	jns	.L2
	movq	-8(%rbp), %rax
	addq	$1000000007, %rax
	jmp	.L4
.L2:
	movq	-8(%rbp), %rax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	MOD, .-MOD
	.globl	power
	.type	power, @function
power:
.LFB7:
	.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	$24, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	cmpq	$0, -32(%rbp)
	jne	.L6
	movl	$1, %eax
	jmp	.L7
.L6:
	movq	-32(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L8
	movq	-32(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rbx
	movq	-24(%rbp), %rax
	imulq	%rax, %rax
	movq	%rax, %rdi
	call	MOD
	movq	%rbx, %rsi
	movq	%rax, %rdi
	call	power
	jmp	.L7
.L8:
	movq	-32(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	power
	imulq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	MOD
.L7:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	power, .-power
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.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	$120, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	$1048576, -96(%rbp)
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-120(%rbp), %rax
	addq	$1, %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -88(%rbp)
	movq	-120(%rbp), %rax
	addq	$1, %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -80(%rbp)
	movq	-80(%rbp), %rax
	movq	$0, (%rax)
	movq	-120(%rbp), %rax
	addq	$1, %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -72(%rbp)
	movq	-72(%rbp), %rax
	movq	$0, (%rax)
	movq	$1, -112(%rbp)
	jmp	.L10
.L13:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-112(%rbp), %rax
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rsi
	movq	-80(%rbp), %rax
	addq	%rsi, %rax
	xorq	%rcx, %rdx
	movq	%rdx, (%rax)
	movq	-112(%rbp), %rax
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-72(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	movq	-80(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	.L11
	movl	$1, %esi
	jmp	.L12
.L11:
	movl	$0, %esi
.L12:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	movq	-72(%rbp), %rax
	addq	%rcx, %rax
	addq	%rsi, %rdx
	movq	%rdx, (%rax)
	addq	$1, -112(%rbp)
.L10:
	movq	-120(%rbp), %rax
	cmpq	%rax, -112(%rbp)
	jle	.L13
	movq	-96(%rbp), %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -64(%rbp)
	movq	$0, -112(%rbp)
	jmp	.L14
.L15:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	addq	$1, -112(%rbp)
.L14:
	movq	-112(%rbp), %rax
	cmpq	-96(%rbp), %rax
	jl	.L15
	movq	-96(%rbp), %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -56(%rbp)
	movq	$0, -112(%rbp)
	jmp	.L16
.L17:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	addq	$1, -112(%rbp)
.L16:
	movq	-112(%rbp), %rax
	cmpq	-96(%rbp), %rax
	jl	.L17
	movq	-96(%rbp), %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -48(%rbp)
	movq	$0, -112(%rbp)
	jmp	.L18
.L19:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	addq	$1, -112(%rbp)
.L18:
	movq	-112(%rbp), %rax
	cmpq	-96(%rbp), %rax
	jl	.L19
	movq	-96(%rbp), %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movq	$0, -112(%rbp)
	jmp	.L20
.L21:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	$1, (%rax)
	addq	$1, -112(%rbp)
.L20:
	movq	-112(%rbp), %rax
	cmpq	-96(%rbp), %rax
	jl	.L21
	movq	$1, -112(%rbp)
	jmp	.L22
.L23:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	-112(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-72(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rdx
	movq	-32(%rbp), %rcx
	leaq	0(,%rcx,8), %rsi
	movq	-64(%rbp), %rcx
	addq	%rsi, %rcx
	movq	(%rcx), %rcx
	leaq	0(,%rcx,8), %rsi
	movq	-72(%rbp), %rcx
	addq	%rsi, %rcx
	movq	(%rcx), %rcx
	subq	%rcx, %rdx
	imulq	%rax, %rdx
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	movq	-40(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	addq	%rdx, %rax
	movq	-32(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-56(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	MOD
	movq	%rax, (%rbx)
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rsi
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	-112(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-72(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rdx
	movq	-32(%rbp), %rcx
	leaq	0(,%rcx,8), %rdi
	movq	-64(%rbp), %rcx
	addq	%rdi, %rcx
	movq	(%rcx), %rcx
	leaq	0(,%rcx,8), %rdi
	movq	-72(%rbp), %rcx
	addq	%rdi, %rcx
	movq	(%rcx), %rcx
	subq	%rcx, %rdx
	imulq	%rdx, %rax
	addq	%rsi, %rax
	movq	-32(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-40(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	MOD
	movq	%rax, (%rbx)
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	movq	-56(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	addq	%rdx, %rax
	movq	-32(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-48(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	MOD
	movq	%rax, (%rbx)
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-64(%rbp), %rax
	addq	%rax, %rdx
	movq	-112(%rbp), %rax
	movq	%rax, (%rdx)
	addq	$1, -112(%rbp)
.L22:
	movq	-120(%rbp), %rax
	cmpq	%rax, -112(%rbp)
	jle	.L23
	movq	$0, -104(%rbp)
	movq	-120(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	.L24
	movq	-120(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-72(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	subq	$1, %rax
	movq	%rax, %rsi
	movl	$2, %edi
	call	power
	movq	%rax, -104(%rbp)
	movq	$1, -112(%rbp)
	jmp	.L25
.L26:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	MOD
	movq	%rax, -104(%rbp)
	addq	$1, -112(%rbp)
.L25:
	movq	-112(%rbp), %rax
	cmpq	-96(%rbp), %rax
	jl	.L26
	jmp	.L27
.L24:
	movq	-120(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -104(%rbp)
.L27:
	movq	-104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	MOD
	.type	MOD, @function
MOD:
.LFB39:
	.cfi_startproc
	endbr64
	movabsq	$-8543223828751151131, %rdx
	movq	%rdi, %rax
	imulq	%rdx
	leaq	(%rdx,%rdi), %rax
	movq	%rdi, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rdi, %rax
	subq	%rdx, %rax
	leaq	1000000007(%rax), %rdx
	cmovs	%rdx, %rax
	ret
	.cfi_endproc
.LFE39:
	.size	MOD, .-MOD
	.p2align 4
	.globl	power
	.type	power, @function
power:
.LFB40:
	.cfi_startproc
	endbr64
	testq	%rsi, %rsi
	je	.L32
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
	movabsq	$-8543223828751151131, %rdi
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	testb	$1, %sil
	je	.L6
	jmp	.L71
	.p2align 4,,10
	.p2align 3
.L58:
	testb	$1, %sil
	jne	.L8
.L6:
	imulq	%rbx, %rbx
	movq	%rsi, %rax
	shrq	$63, %rax
	addq	%rax, %rsi
	movq	%rbx, %rax
	movq	%rbx, %rcx
	mulq	%rdi
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	sarq	%rsi
	movq	%rcx, %rbx
	jne	.L58
	movl	$1, %eax
.L4:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	subq	$1, %rsi
	je	.L72
.L31:
	movabsq	$-8543223828751151131, %rdi
	movq	%rbx, %rbp
	testb	$1, %sil
	je	.L11
	jmp	.L73
	.p2align 4,,10
	.p2align 3
.L60:
	testb	$1, %sil
	jne	.L13
.L11:
	movq	%rbp, %rcx
	movq	%rsi, %rax
	imulq	%rbp, %rcx
	shrq	$63, %rax
	addq	%rax, %rsi
	movq	%rcx, %rax
	mulq	%rdi
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	sarq	%rsi
	movq	%rcx, %rbp
	jne	.L60
.L10:
	movabsq	$-8543223828751151131, %rdx
	movq	%rbx, %rax
	imulq	%rdx
	leaq	(%rdx,%rbx), %rax
	movq	%rbx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rbx, %rax
	subq	%rdx, %rax
	leaq	1000000007(%rax), %rdx
	cmovs	%rdx, %rax
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	subq	$1, %rsi
	je	.L74
.L30:
	movabsq	$-8543223828751151131, %rdi
	movq	%rbp, %r12
	testb	$1, %sil
	je	.L16
	jmp	.L75
	.p2align 4,,10
	.p2align 3
.L62:
	testb	$1, %sil
	jne	.L18
.L16:
	movq	%r12, %rcx
	movq	%rsi, %rax
	imulq	%r12, %rcx
	shrq	$63, %rax
	addq	%rax, %rsi
	movq	%rcx, %rax
	mulq	%rdi
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	sarq	%rsi
	movq	%rcx, %r12
	jne	.L62
.L15:
	movabsq	$-8543223828751151131, %rdx
	movq	%rbp, %rax
	imulq	%rdx
	leaq	(%rdx,%rbp), %rax
	movq	%rbp, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rbp, %rax
	subq	%rdx, %rax
	js	.L26
.L70:
	imulq	%rax, %rbx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L26:
	addq	$1000000007, %rax
	jmp	.L70
	.p2align 4,,10
	.p2align 3
.L18:
	subq	$1, %rsi
	je	.L76
.L28:
	movabsq	$-8543223828751151131, %rdi
	movq	%r12, %rdx
	testb	$1, %sil
	je	.L21
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L63:
	testb	$1, %sil
	jne	.L22
.L21:
	imulq	%rdx, %rdx
	movq	%rsi, %rax
	shrq	$63, %rax
	addq	%rax, %rsi
	movq	%rdx, %rax
	movq	%rdx, %rcx
	mulq	%rdi
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	movq	%rcx, %rdx
	subq	%rax, %rdx
	sarq	%rsi
	jne	.L63
.L20:
	movabsq	$-8543223828751151131, %rdx
	movq	%r12, %rax
	imulq	%rdx
	leaq	(%rdx,%r12), %rax
	movq	%r12, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%r12, %rax
	subq	%rdx, %rax
	jns	.L69
	addq	$1000000007, %rax
.L69:
	imulq	%rax, %rbp
	jmp	.L15
.L22:
	movq	%rdx, %rdi
	subq	$1, %rsi
	movq	%rdx, 8(%rsp)
	call	power
	movq	8(%rsp), %rdx
	imulq	%rdx, %rax
	movabsq	$-8543223828751151131, %rdx
	movq	%rax, %rcx
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	js	.L24
.L68:
	imulq	%rax, %r12
	jmp	.L20
.L32:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	movl	$1, %eax
	ret
.L71:
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -32
	.cfi_offset 6, -24
	.cfi_offset 12, -16
	subq	$1, %rsi
	jne	.L31
	jmp	.L10
.L24:
	addq	$1000000007, %rax
	jmp	.L68
.L74:
	imulq	%rbp, %rbx
	jmp	.L10
.L73:
	subq	$1, %rsi
	jne	.L30
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L72:
	movq	%rbx, %rax
	jmp	.L4
.L75:
	subq	$1, %rsi
	jne	.L28
	jmp	.L20
.L76:
	imulq	%r12, %rbp
	jmp	.L15
	.cfi_endproc
.LFE40:
	.size	power, .-power
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r15, %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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	32(%rsp), %r12
	leaq	8(,%r12,8), %r13
	movq	%r13, %rdi
	call	malloc@PLT
	movq	%r13, %rdi
	movq	%rax, %r14
	call	malloc@PLT
	movq	%r13, %rdi
	movq	$0, (%rax)
	movq	%rax, %rbp
	call	malloc@PLT
	movq	$0, (%rax)
	movq	%rax, %rbx
	testq	%r12, %r12
	jle	.L78
	addq	$8, %r14
	movl	$1, %r13d
	.p2align 4,,10
	.p2align 3
.L79:
	movq	%r14, %rsi
	xorl	%eax, %eax
	movq	%r15, %rdi
	call	__isoc99_scanf@PLT
	movq	-8(%rbp,%r13,8), %rdx
	movq	(%r14), %rax
	movq	32(%rsp), %r12
	movq	%rdx, %rcx
	xorq	%rax, %rcx
	cmpq	%rax, %rdx
	sete	%al
	movq	%rcx, 0(%rbp,%r13,8)
	addq	$8, %r14
	movzbl	%al, %eax
	addq	-8(%rbx,%r13,8), %rax
	movq	%rax, (%rbx,%r13,8)
	addq	$1, %r13
	cmpq	%r13, %r12
	jge	.L79
.L78:
	movl	$1, %esi
	movl	$8388608, %edi
	call	calloc@PLT
	movl	$1, %esi
	movl	$8388608, %edi
	movq	%rax, 16(%rsp)
	call	calloc@PLT
	movl	$1, %esi
	movl	$8388608, %edi
	movq	%rax, %r13
	call	calloc@PLT
	movl	$8388608, %edi
	movq	%rax, 8(%rsp)
	call	malloc@PLT
	movdqa	.LC1(%rip), %xmm0
	movq	%rax, %r15
	leaq	8388608(%rax), %rdx
	.p2align 4,,10
	.p2align 3
.L80:
	movups	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L80
	testq	%r12, %r12
	jle	.L81
	movq	%r12, 24(%rsp)
	leaq	1(%r12), %r10
	movq	16(%rsp), %r12
	movl	$1, %edi
	movabsq	$-8543223828751151131, %r14
	.p2align 4,,10
	.p2align 3
.L84:
	movq	0(%rbp,%rdi,8), %rax
	movq	(%rbx,%rdi,8), %rcx
	leaq	0(,%rax,8), %rsi
	movq	8(%rsp), %rax
	leaq	(%r12,%rsi), %r8
	leaq	(%r15,%rsi), %r11
	leaq	(%rax,%rsi), %r9
	movq	(%r8), %rax
	movq	%rdi, (%r8)
	subq	(%rbx,%rax,8), %rcx
	imulq	(%r9), %rcx
	addq	(%r11), %rcx
	movq	%rcx, %rax
	imulq	%r14
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	leaq	1000000007(%rax), %rdx
	cmovs	%rdx, %rax
	movq	%rax, 0(%r13,%rsi)
	movq	%rax, (%r11)
	addq	(%r9), %rax
	movq	%rax, %rcx
	imulq	%r14
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	leaq	1000000007(%rcx), %rax
	cmovs	%rax, %rdx
	addq	$1, %rdi
	movq	%rdx, (%r9)
	cmpq	%rdi, %r10
	jne	.L84
	movq	24(%rsp), %r12
.L81:
	movq	0(%rbp,%r12,8), %rax
	testq	%rax, %rax
	je	.L95
	movq	0(%r13,%rax,8), %rdx
.L88:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L96
	addq	$56, %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
.L95:
	.cfi_restore_state
	movq	(%rbx,%r12,8), %rsi
	movl	$2, %edi
	movabsq	$-8543223828751151131, %r8
	subq	$1, %rsi
	call	power
	movq	%rax, %rdx
	movq	8(%rsp), %rax
	leaq	8(%rax), %rsi
	leaq	8388608(%rax), %rdi
	.p2align 4,,10
	.p2align 3
.L87:
	movq	(%rsi), %rcx
	addq	%rdx, %rcx
	movq	%rcx, %rax
	imulq	%r8
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	leaq	1000000007(%rcx), %rax
	cmovs	%rax, %rdx
	addq	$8, %rsi
	cmpq	%rdi, %rsi
	jne	.L87
	jmp	.L88
.L96:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.quad	1
	.quad	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:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	MOD
	.type	MOD, @function
MOD:
.LFB39:
	.cfi_startproc
	endbr64
	movabsq	$-8543223828751151131, %rdx
	movq	%rdi, %rax
	imulq	%rdx
	leaq	(%rdx,%rdi), %rax
	movq	%rdi, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rdi, %rax
	subq	%rdx, %rax
	leaq	1000000007(%rax), %rdx
	cmovs	%rdx, %rax
	ret
	.cfi_endproc
.LFE39:
	.size	MOD, .-MOD
	.p2align 4
	.globl	power
	.type	power, @function
power:
.LFB40:
	.cfi_startproc
	endbr64
	testq	%rsi, %rsi
	je	.L32
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
	movabsq	$-8543223828751151131, %rdi
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	testb	$1, %sil
	je	.L6
	jmp	.L71
	.p2align 4,,10
	.p2align 3
.L58:
	testb	$1, %sil
	jne	.L8
.L6:
	imulq	%rbx, %rbx
	movq	%rsi, %rax
	shrq	$63, %rax
	addq	%rax, %rsi
	movq	%rbx, %rax
	movq	%rbx, %rcx
	mulq	%rdi
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	sarq	%rsi
	movq	%rcx, %rbx
	jne	.L58
	movl	$1, %eax
.L4:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	subq	$1, %rsi
	je	.L72
.L31:
	movabsq	$-8543223828751151131, %rdi
	movq	%rbx, %rbp
	testb	$1, %sil
	je	.L11
	jmp	.L73
	.p2align 4,,10
	.p2align 3
.L60:
	testb	$1, %sil
	jne	.L13
.L11:
	movq	%rbp, %rcx
	movq	%rsi, %rax
	imulq	%rbp, %rcx
	shrq	$63, %rax
	addq	%rax, %rsi
	movq	%rcx, %rax
	mulq	%rdi
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	sarq	%rsi
	movq	%rcx, %rbp
	jne	.L60
.L10:
	movabsq	$-8543223828751151131, %rdx
	movq	%rbx, %rax
	imulq	%rdx
	leaq	(%rdx,%rbx), %rax
	movq	%rbx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rbx, %rax
	subq	%rdx, %rax
	leaq	1000000007(%rax), %rdx
	cmovs	%rdx, %rax
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	subq	$1, %rsi
	je	.L74
.L30:
	movabsq	$-8543223828751151131, %rdi
	movq	%rbp, %r12
	testb	$1, %sil
	je	.L16
	jmp	.L75
	.p2align 4,,10
	.p2align 3
.L62:
	testb	$1, %sil
	jne	.L18
.L16:
	movq	%r12, %rcx
	movq	%rsi, %rax
	imulq	%r12, %rcx
	shrq	$63, %rax
	addq	%rax, %rsi
	movq	%rcx, %rax
	mulq	%rdi
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	sarq	%rsi
	movq	%rcx, %r12
	jne	.L62
.L15:
	movabsq	$-8543223828751151131, %rdx
	movq	%rbp, %rax
	imulq	%rdx
	leaq	(%rdx,%rbp), %rax
	movq	%rbp, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rbp, %rax
	subq	%rdx, %rax
	js	.L26
.L70:
	imulq	%rax, %rbx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L26:
	addq	$1000000007, %rax
	jmp	.L70
	.p2align 4,,10
	.p2align 3
.L18:
	subq	$1, %rsi
	je	.L76
.L28:
	movabsq	$-8543223828751151131, %rdi
	movq	%r12, %rdx
	testb	$1, %sil
	je	.L21
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L63:
	testb	$1, %sil
	jne	.L22
.L21:
	imulq	%rdx, %rdx
	movq	%rsi, %rax
	shrq	$63, %rax
	addq	%rax, %rsi
	movq	%rdx, %rax
	movq	%rdx, %rcx
	mulq	%rdi
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	movq	%rcx, %rdx
	subq	%rax, %rdx
	sarq	%rsi
	jne	.L63
.L20:
	movabsq	$-8543223828751151131, %rdx
	movq	%r12, %rax
	imulq	%rdx
	leaq	(%rdx,%r12), %rax
	movq	%r12, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%r12, %rax
	subq	%rdx, %rax
	jns	.L69
	addq	$1000000007, %rax
.L69:
	imulq	%rax, %rbp
	jmp	.L15
.L22:
	movq	%rdx, %rdi
	subq	$1, %rsi
	movq	%rdx, 8(%rsp)
	call	power
	movq	8(%rsp), %rdx
	imulq	%rdx, %rax
	movabsq	$-8543223828751151131, %rdx
	movq	%rax, %rcx
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	js	.L24
.L68:
	imulq	%rax, %r12
	jmp	.L20
.L32:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	movl	$1, %eax
	ret
.L71:
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -32
	.cfi_offset 6, -24
	.cfi_offset 12, -16
	subq	$1, %rsi
	jne	.L31
	jmp	.L10
.L24:
	addq	$1000000007, %rax
	jmp	.L68
.L74:
	imulq	%rbp, %rbx
	jmp	.L10
.L73:
	subq	$1, %rsi
	jne	.L30
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L72:
	movq	%rbx, %rax
	jmp	.L4
.L75:
	subq	$1, %rsi
	jne	.L28
	jmp	.L20
.L76:
	imulq	%r12, %rbp
	jmp	.L15
	.cfi_endproc
.LFE40:
	.size	power, .-power
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r15, %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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	32(%rsp), %r12
	leaq	8(,%r12,8), %r13
	movq	%r13, %rdi
	call	malloc@PLT
	movq	%r13, %rdi
	movq	%rax, %r14
	call	malloc@PLT
	movq	%r13, %rdi
	movq	$0, (%rax)
	movq	%rax, %rbp
	call	malloc@PLT
	movq	$0, (%rax)
	movq	%rax, %rbx
	testq	%r12, %r12
	jle	.L78
	addq	$8, %r14
	movl	$1, %r13d
	.p2align 4,,10
	.p2align 3
.L79:
	movq	%r14, %rsi
	xorl	%eax, %eax
	movq	%r15, %rdi
	call	__isoc99_scanf@PLT
	movq	-8(%rbp,%r13,8), %rdx
	movq	(%r14), %rax
	movq	32(%rsp), %r12
	movq	%rdx, %rcx
	xorq	%rax, %rcx
	cmpq	%rax, %rdx
	sete	%al
	movq	%rcx, 0(%rbp,%r13,8)
	addq	$8, %r14
	movzbl	%al, %eax
	addq	-8(%rbx,%r13,8), %rax
	movq	%rax, (%rbx,%r13,8)
	addq	$1, %r13
	cmpq	%r13, %r12
	jge	.L79
.L78:
	movl	$1, %esi
	movl	$8388608, %edi
	call	calloc@PLT
	movl	$1, %esi
	movl	$8388608, %edi
	movq	%rax, 16(%rsp)
	call	calloc@PLT
	movl	$1, %esi
	movl	$8388608, %edi
	movq	%rax, %r13
	call	calloc@PLT
	movl	$8388608, %edi
	movq	%rax, 8(%rsp)
	call	malloc@PLT
	movdqa	.LC1(%rip), %xmm0
	movq	%rax, %r15
	leaq	8388608(%rax), %rdx
	.p2align 4,,10
	.p2align 3
.L80:
	movups	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L80
	testq	%r12, %r12
	jle	.L81
	movq	%r12, 24(%rsp)
	leaq	1(%r12), %r10
	movq	16(%rsp), %r12
	movl	$1, %edi
	movabsq	$-8543223828751151131, %r14
	.p2align 4,,10
	.p2align 3
.L84:
	movq	0(%rbp,%rdi,8), %rax
	movq	(%rbx,%rdi,8), %rcx
	leaq	0(,%rax,8), %rsi
	movq	8(%rsp), %rax
	leaq	(%r12,%rsi), %r8
	leaq	(%r15,%rsi), %r11
	leaq	(%rax,%rsi), %r9
	movq	(%r8), %rax
	movq	%rdi, (%r8)
	subq	(%rbx,%rax,8), %rcx
	imulq	(%r9), %rcx
	addq	(%r11), %rcx
	movq	%rcx, %rax
	imulq	%r14
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	leaq	1000000007(%rax), %rdx
	cmovs	%rdx, %rax
	movq	%rax, 0(%r13,%rsi)
	movq	%rax, (%r11)
	addq	(%r9), %rax
	movq	%rax, %rcx
	imulq	%r14
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	leaq	1000000007(%rcx), %rax
	cmovs	%rax, %rdx
	addq	$1, %rdi
	movq	%rdx, (%r9)
	cmpq	%rdi, %r10
	jne	.L84
	movq	24(%rsp), %r12
.L81:
	movq	0(%rbp,%r12,8), %rax
	testq	%rax, %rax
	je	.L95
	movq	0(%r13,%rax,8), %rdx
.L88:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L96
	addq	$56, %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
.L95:
	.cfi_restore_state
	movq	(%rbx,%r12,8), %rsi
	movl	$2, %edi
	movabsq	$-8543223828751151131, %r8
	subq	$1, %rsi
	call	power
	movq	%rax, %rdx
	movq	8(%rsp), %rax
	leaq	8(%rax), %rsi
	leaq	8388608(%rax), %rdi
	.p2align 4,,10
	.p2align 3
.L87:
	movq	(%rsi), %rcx
	addq	%rdx, %rcx
	movq	%rcx, %rax
	imulq	%r8
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	leaq	1000000007(%rcx), %rax
	cmovs	%rax, %rdx
	addq	$8, %rsi
	cmpq	%rdi, %rsi
	jne	.L87
	jmp	.L88
.L96:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.quad	1
	.quad	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:

#include <stdio.h>
#include <stdlib.h>
#define int long long
#define p (int)(1e9 + 7)

int MOD(int a){
	a %= p;
	return a >= 0 ? a : a + p;
}

int power(int a, int N){
	if(N == 0){
		return 1;
	}
	else if(N % 2 == 0){
		return power(MOD(a * a), N / 2);
	}
	else{
		return MOD(a * power(a, N - 1));
	}
}

signed main(){
	int M = ((int)1 << 20);
	int N, i, x;
	scanf("%lld", &N);
	int *a = (int *)malloc(sizeof(int) * (N + 1));
	int *s = (int *)malloc(sizeof(int) * (N + 1));
	s[0] = 0;
	int *Onum = (int *)malloc(sizeof(int) * (N + 1));
	Onum[0] = 0;
	for(i = 1; i <= N; i++){
		scanf("%lld", &a[i]);
		s[i] = (s[i - 1] ^ a[i]);
		Onum[i] = Onum[i - 1] + (s[i] == 0 ? 1 : 0);
	}
/*	printf("s:\n");
	for(i = 0; i <= N; i++){
		printf("%lld ", s[i]);
	}
	printf("\n");
	printf("Onum:\n");
	for(i = 0; i <= N; i++){
		printf("%lld ", Onum[i]);
	}
	printf("\n");
*/	int *prev = (int *)malloc(sizeof(int) * M);
	for(i = 0; i < M; i++){
		prev[i] = 0;
	}
	int *dp = (int *)malloc(sizeof(int) * M);
	for(i = 0; i < M; i++){
		dp[i] = 0;
	}
	int *sum = (int *)malloc(sizeof(int) * M);
	for(i = 0; i < M; i++){
		sum[i] = 0;
	}
	int *Osum = (int *)malloc(sizeof(int) * M);
	for(i = 0; i < M; i++){
		Osum[i] = 1;
	}
	for(i = 1; i <= N; i++){
		x = s[i];
		dp[x] = MOD(sum[x] * (Onum[i] - Onum[prev[x]]) + Osum[x]);
		Osum[x] = MOD(Osum[x] + sum[x] * (Onum[i] - Onum[prev[x]]));
		sum[x] = MOD(sum[x] + dp[x]);
/*		if(prev[x] == -1){
			dp[x] = 1;
			sum[x] = 1;
		}
		else{
			dp[x] = MOD(sum[x] * (Onum[i] - Onum[prev[x]]) + 1);
			sum[x] = MOD(sum[x] + dp[x]);
		}
*/		prev[x] = i;
//		printf("i = %lld\n", i);
//		printf("dp[%lld] = %lld\n", x, dp[x]);
//		printf("sum[%lld] = %lld\n", x, sum[x]);
	}
	int ans = 0;
	if(s[N] == 0){
		ans = power(2, Onum[N] - 1);
		for(i = 1; i < M; i++){
			ans = MOD(ans + sum[i]);
		}
	}
	else{
		ans = dp[s[N]];
	}
/*	for(i = 1; i < M; i++){
		if(s[N] == 0){
			ans = MOD(ans + sum[i]);
		}
		else if(s[N] == i){
			ans = MOD(ans + dp[i]);
		}
	}
	if(s[N] == 0){
		ans = MOD(ans + power(2, Onum[N] - 1));
	}
*/	printf("%lld\n", ans);
	return 0;
}
32
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
 24
1 2 5 3 3 6 1 1 15 8 0 3 3 4 6 6 4 0 7 2 5 4 6 2
 3
2 2 0
 24
1 2 5 3 3 6 1 2 15 8 0 3 3 4 6 6 4 0 7 2 5 4 6 2
 24
1 4 5 3 3 6 1 2 15 8 0 3 3 4 6 6 4 0 7 2 5 4 6 2
 24
1 4 5 3 3 6 2 2 15 8 0 3 3 4 6 6 1 0 7 2 5 4 6 2
 24
1 4 5 3 1 6 2 2 15 8 0 3 3 4 6 6 1 0 7 2 5 4 6 2
 32
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0
 24
1 0 5 3 1 6 2 2 15 8 0 3 3 4 6 6 1 0 7 2 5 4 6 2
 32
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 1 0 0

1
 6
 3
 31
 19
 5
 2
 33554438
 9
 268435465

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

```c
#include <stdio.h>
#include <stdlib.h>
#define int long long
#define p (int)(1e9 + 7)

int MOD(int a){
	a %= p;
	return a >= 0 ? a : a + p;
}

int power(int a, int N){
	if(N == 0){
		return 1;
	}
	else if(N % 2 == 0){
		return power(MOD(a * a), N / 2);
	}
	else{
		return MOD(a * power(a, N - 1));
	}
}

signed main(){
	int M = ((int)1 << 20);
	int N, i, x;
	scanf("%lld", &N);
	int *a = (int *)malloc(sizeof(int) * (N + 1));
	int *s = (int *)malloc(sizeof(int) * (N + 1));
	s[0] = 0;
	int *Onum = (int *)malloc(sizeof(int) * (N + 1));
	Onum[0] = 0;
	for(i = 1; i <= N; i++){
		scanf("%lld", &a[i]);
		s[i] = (s[i - 1] ^ a[i]);
		Onum[i] = Onum[i - 1] + (s[i] == 0 ? 1 : 0);
	}
/*	printf("s:\n");
	for(i = 0; i <= N; i++){
		printf("%lld ", s[i]);
	}
	printf("\n");
	printf("Onum:\n");
	for(i = 0; i <= N; i++){
		printf("%lld ", Onum[i]);
	}
	printf("\n");
*/	int *prev = (int *)malloc(sizeof(int) * M);
	for(i = 0; i < M; i++){
		prev[i] = 0;
	}
	int *dp = (int *)malloc(sizeof(int) * M);
	for(i = 0; i < M; i++){
		dp[i] = 0;
	}
	int *sum = (int *)malloc(sizeof(int) * M);
	for(i = 0; i < M; i++){
		sum[i] = 0;
	}
	int *Osum = (int *)malloc(sizeof(int) * M);
	for(i = 0; i < M; i++){
		Osum[i] = 1;
	}
	for(i = 1; i <= N; i++){
		x = s[i];
		dp[x] = MOD(sum[x] * (Onum[i] - Onum[prev[x]]) + Osum[x]);
		Osum[x] = MOD(Osum[x] + sum[x] * (Onum[i] - Onum[prev[x]]));
		sum[x] = MOD(sum[x] + dp[x]);
/*		if(prev[x] == -1){
			dp[x] = 1;
			sum[x] = 1;
		}
		else{
			dp[x] = MOD(sum[x] * (Onum[i] - Onum[prev[x]]) + 1);
			sum[x] = MOD(sum[x] + dp[x]);
		}
*/		prev[x] = i;
//		printf("i = %lld\n", i);
//		printf("dp[%lld] = %lld\n", x, dp[x]);
//		printf("sum[%lld] = %lld\n", x, sum[x]);
	}
	int ans = 0;
	if(s[N] == 0){
		ans = power(2, Onum[N] - 1);
		for(i = 1; i < M; i++){
			ans = MOD(ans + sum[i]);
		}
	}
	else{
		ans = dp[s[N]];
	}
/*	for(i = 1; i < M; i++){
		if(s[N] == 0){
			ans = MOD(ans + sum[i]);
		}
		else if(s[N] == i){
			ans = MOD(ans + dp[i]);
		}
	}
	if(s[N] == 0){
		ans = MOD(ans + power(2, Onum[N] - 1));
	}
*/	printf("%lld\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	MOD
	.type	MOD, @function
MOD:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	jns	.L2
	movq	-8(%rbp), %rax
	addq	$1000000007, %rax
	jmp	.L4
.L2:
	movq	-8(%rbp), %rax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	MOD, .-MOD
	.globl	power
	.type	power, @function
power:
.LFB7:
	.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	$24, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	cmpq	$0, -32(%rbp)
	jne	.L6
	movl	$1, %eax
	jmp	.L7
.L6:
	movq	-32(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L8
	movq	-32(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rbx
	movq	-24(%rbp), %rax
	imulq	%rax, %rax
	movq	%rax, %rdi
	call	MOD
	movq	%rbx, %rsi
	movq	%rax, %rdi
	call	power
	jmp	.L7
.L8:
	movq	-32(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	power
	imulq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	MOD
.L7:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	power, .-power
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.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	$120, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	$1048576, -96(%rbp)
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-120(%rbp), %rax
	addq	$1, %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -88(%rbp)
	movq	-120(%rbp), %rax
	addq	$1, %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -80(%rbp)
	movq	-80(%rbp), %rax
	movq	$0, (%rax)
	movq	-120(%rbp), %rax
	addq	$1, %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -72(%rbp)
	movq	-72(%rbp), %rax
	movq	$0, (%rax)
	movq	$1, -112(%rbp)
	jmp	.L10
.L13:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-112(%rbp), %rax
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rsi
	movq	-80(%rbp), %rax
	addq	%rsi, %rax
	xorq	%rcx, %rdx
	movq	%rdx, (%rax)
	movq	-112(%rbp), %rax
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-72(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	movq	-80(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	.L11
	movl	$1, %esi
	jmp	.L12
.L11:
	movl	$0, %esi
.L12:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	movq	-72(%rbp), %rax
	addq	%rcx, %rax
	addq	%rsi, %rdx
	movq	%rdx, (%rax)
	addq	$1, -112(%rbp)
.L10:
	movq	-120(%rbp), %rax
	cmpq	%rax, -112(%rbp)
	jle	.L13
	movq	-96(%rbp), %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -64(%rbp)
	movq	$0, -112(%rbp)
	jmp	.L14
.L15:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	addq	$1, -112(%rbp)
.L14:
	movq	-112(%rbp), %rax
	cmpq	-96(%rbp), %rax
	jl	.L15
	movq	-96(%rbp), %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -56(%rbp)
	movq	$0, -112(%rbp)
	jmp	.L16
.L17:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	addq	$1, -112(%rbp)
.L16:
	movq	-112(%rbp), %rax
	cmpq	-96(%rbp), %rax
	jl	.L17
	movq	-96(%rbp), %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -48(%rbp)
	movq	$0, -112(%rbp)
	jmp	.L18
.L19:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	addq	$1, -112(%rbp)
.L18:
	movq	-112(%rbp), %rax
	cmpq	-96(%rbp), %rax
	jl	.L19
	movq	-96(%rbp), %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movq	$0, -112(%rbp)
	jmp	.L20
.L21:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	$1, (%rax)
	addq	$1, -112(%rbp)
.L20:
	movq	-112(%rbp), %rax
	cmpq	-96(%rbp), %rax
	jl	.L21
	movq	$1, -112(%rbp)
	jmp	.L22
.L23:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	-112(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-72(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rdx
	movq	-32(%rbp), %rcx
	leaq	0(,%rcx,8), %rsi
	movq	-64(%rbp), %rcx
	addq	%rsi, %rcx
	movq	(%rcx), %rcx
	leaq	0(,%rcx,8), %rsi
	movq	-72(%rbp), %rcx
	addq	%rsi, %rcx
	movq	(%rcx), %rcx
	subq	%rcx, %rdx
	imulq	%rax, %rdx
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	movq	-40(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	addq	%rdx, %rax
	movq	-32(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-56(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	MOD
	movq	%rax, (%rbx)
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rsi
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	-112(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-72(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rdx
	movq	-32(%rbp), %rcx
	leaq	0(,%rcx,8), %rdi
	movq	-64(%rbp), %rcx
	addq	%rdi, %rcx
	movq	(%rcx), %rcx
	leaq	0(,%rcx,8), %rdi
	movq	-72(%rbp), %rcx
	addq	%rdi, %rcx
	movq	(%rcx), %rcx
	subq	%rcx, %rdx
	imulq	%rdx, %rax
	addq	%rsi, %rax
	movq	-32(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-40(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	MOD
	movq	%rax, (%rbx)
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	movq	-56(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	addq	%rdx, %rax
	movq	-32(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-48(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	MOD
	movq	%rax, (%rbx)
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-64(%rbp), %rax
	addq	%rax, %rdx
	movq	-112(%rbp), %rax
	movq	%rax, (%rdx)
	addq	$1, -112(%rbp)
.L22:
	movq	-120(%rbp), %rax
	cmpq	%rax, -112(%rbp)
	jle	.L23
	movq	$0, -104(%rbp)
	movq	-120(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	.L24
	movq	-120(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-72(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	subq	$1, %rax
	movq	%rax, %rsi
	movl	$2, %edi
	call	power
	movq	%rax, -104(%rbp)
	movq	$1, -112(%rbp)
	jmp	.L25
.L26:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	MOD
	movq	%rax, -104(%rbp)
	addq	$1, -112(%rbp)
.L25:
	movq	-112(%rbp), %rax
	cmpq	-96(%rbp), %rax
	jl	.L26
	jmp	.L27
.L24:
	movq	-120(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -104(%rbp)
.L27:
	movq	-104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	MOD
	.type	MOD, @function
MOD:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	jns	.L2
	movq	-8(%rbp), %rax
	addq	$1000000007, %rax
	jmp	.L4
.L2:
	movq	-8(%rbp), %rax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	MOD, .-MOD
	.globl	power
	.type	power, @function
power:
.LFB7:
	.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	$24, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	cmpq	$0, -32(%rbp)
	jne	.L6
	movl	$1, %eax
	jmp	.L7
.L6:
	movq	-32(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L8
	movq	-32(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rbx
	movq	-24(%rbp), %rax
	imulq	%rax, %rax
	movq	%rax, %rdi
	call	MOD
	movq	%rbx, %rsi
	movq	%rax, %rdi
	call	power
	jmp	.L7
.L8:
	movq	-32(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	power
	imulq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	MOD
.L7:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	power, .-power
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.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	$120, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	$1048576, -96(%rbp)
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-120(%rbp), %rax
	addq	$1, %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -88(%rbp)
	movq	-120(%rbp), %rax
	addq	$1, %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -80(%rbp)
	movq	-80(%rbp), %rax
	movq	$0, (%rax)
	movq	-120(%rbp), %rax
	addq	$1, %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -72(%rbp)
	movq	-72(%rbp), %rax
	movq	$0, (%rax)
	movq	$1, -112(%rbp)
	jmp	.L10
.L13:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-112(%rbp), %rax
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rsi
	movq	-80(%rbp), %rax
	addq	%rsi, %rax
	xorq	%rcx, %rdx
	movq	%rdx, (%rax)
	movq	-112(%rbp), %rax
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-72(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	movq	-80(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	.L11
	movl	$1, %esi
	jmp	.L12
.L11:
	movl	$0, %esi
.L12:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	movq	-72(%rbp), %rax
	addq	%rcx, %rax
	addq	%rsi, %rdx
	movq	%rdx, (%rax)
	addq	$1, -112(%rbp)
.L10:
	movq	-120(%rbp), %rax
	cmpq	%rax, -112(%rbp)
	jle	.L13
	movq	-96(%rbp), %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -64(%rbp)
	movq	$0, -112(%rbp)
	jmp	.L14
.L15:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	addq	$1, -112(%rbp)
.L14:
	movq	-112(%rbp), %rax
	cmpq	-96(%rbp), %rax
	jl	.L15
	movq	-96(%rbp), %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -56(%rbp)
	movq	$0, -112(%rbp)
	jmp	.L16
.L17:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	addq	$1, -112(%rbp)
.L16:
	movq	-112(%rbp), %rax
	cmpq	-96(%rbp), %rax
	jl	.L17
	movq	-96(%rbp), %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -48(%rbp)
	movq	$0, -112(%rbp)
	jmp	.L18
.L19:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	addq	$1, -112(%rbp)
.L18:
	movq	-112(%rbp), %rax
	cmpq	-96(%rbp), %rax
	jl	.L19
	movq	-96(%rbp), %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movq	$0, -112(%rbp)
	jmp	.L20
.L21:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	$1, (%rax)
	addq	$1, -112(%rbp)
.L20:
	movq	-112(%rbp), %rax
	cmpq	-96(%rbp), %rax
	jl	.L21
	movq	$1, -112(%rbp)
	jmp	.L22
.L23:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	-112(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-72(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rdx
	movq	-32(%rbp), %rcx
	leaq	0(,%rcx,8), %rsi
	movq	-64(%rbp), %rcx
	addq	%rsi, %rcx
	movq	(%rcx), %rcx
	leaq	0(,%rcx,8), %rsi
	movq	-72(%rbp), %rcx
	addq	%rsi, %rcx
	movq	(%rcx), %rcx
	subq	%rcx, %rdx
	imulq	%rax, %rdx
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	movq	-40(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	addq	%rdx, %rax
	movq	-32(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-56(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	MOD
	movq	%rax, (%rbx)
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rsi
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	-112(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-72(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rdx
	movq	-32(%rbp), %rcx
	leaq	0(,%rcx,8), %rdi
	movq	-64(%rbp), %rcx
	addq	%rdi, %rcx
	movq	(%rcx), %rcx
	leaq	0(,%rcx,8), %rdi
	movq	-72(%rbp), %rcx
	addq	%rdi, %rcx
	movq	(%rcx), %rcx
	subq	%rcx, %rdx
	imulq	%rdx, %rax
	addq	%rsi, %rax
	movq	-32(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-40(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	MOD
	movq	%rax, (%rbx)
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	movq	-56(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	addq	%rdx, %rax
	movq	-32(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-48(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	MOD
	movq	%rax, (%rbx)
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-64(%rbp), %rax
	addq	%rax, %rdx
	movq	-112(%rbp), %rax
	movq	%rax, (%rdx)
	addq	$1, -112(%rbp)
.L22:
	movq	-120(%rbp), %rax
	cmpq	%rax, -112(%rbp)
	jle	.L23
	movq	$0, -104(%rbp)
	movq	-120(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	.L24
	movq	-120(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-72(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	subq	$1, %rax
	movq	%rax, %rsi
	movl	$2, %edi
	call	power
	movq	%rax, -104(%rbp)
	movq	$1, -112(%rbp)
	jmp	.L25
.L26:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	MOD
	movq	%rax, -104(%rbp)
	addq	$1, -112(%rbp)
.L25:
	movq	-112(%rbp), %rax
	cmpq	-96(%rbp), %rax
	jl	.L26
	jmp	.L27
.L24:
	movq	-120(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -104(%rbp)
.L27:
	movq	-104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
