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

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
long long factorial(long long);
int /*<<< orphan*/ printf(char *, long long);
int /*<<< orphan*/ scanf(char *, long long *, long long *);
int main() {
  long long int x, y;
  scanf("%lld%lld", &x, &y);
  x = factorial(x);
  y = factorial(y);
  long long int answer = (x + y) % 1000000007;
  printf("%lld\n", answer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <factorial@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <factorial@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    $0x3b9aca07,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1050 <scanf@plt>
mov    0x8(%rsp),%rdi
call   1030 <factorial@plt>
mov    %rax,0x8(%rsp)
mov    0x10(%rsp),%rdi
call   1030 <factorial@plt>
mov    %rax,%rsi
mov    %rax,0x10(%rsp)
add    0x8(%rsp),%rsi
movabs $0x89705f3112a28fe5,%rcx
5f 70 89
mov    %rsi,%rax
imul   %rcx
add    %rsi,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x1d,%rdx
add    %rax,%rdx
imul   $0x3b9aca07,%rdx,%rax
sub    %rax,%rsi
lea    0xe67(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%lld%lld\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64* %2, i64* %3)
%6 = load i64, i64* %2
%7 = call i64 @factorial(i64 %6)
store i64 %7, i64* %2
%8 = load i64, i64* %3
%9 = call i64 @factorial(i64 %8)
store i64 %9, i64* %3
%10 = load i64, i64* %2
%11 = load i64, i64* %3
%12 = add nsw i64 %10, %11
%13 = srem i64 %12, 1000000007
store i64 %13, i64* %4
%14 = load i64, i64* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%lld%lld\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%6 = load i64, i64* %1
%7 = call i64 @factorial(i64 %6)
store i64 %7, i64* %1
%8 = load i64, i64* %2
%9 = call i64 @factorial(i64 %8)
store i64 %9, i64* %2
%10 = load i64, i64* %1
%11 = add nsw i64 %10, %9
%12 = srem i64 %11, 1000000007
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %12)
ret i32 0
}