/* -*- coding: utf-8 -*- * * 1165.cc: No.1165 Paint Squares - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int MOD = 1000000007; /* typedef */ typedef long long ll; /* global variables */ /* subroutines */ int powmod(int a, int n) { // a^n % MOD int pm = 1; while (n > 0) { if (n & 1) pm = (ll)pm * a % MOD; a = (ll)a * a % MOD; n >>= 1; } return pm; } /* main */ int main() { int p, q; scanf("%d%d", &p, &q); int r = ((ll)6 * (powmod(2, p) + powmod(2, q)) % MOD + (MOD - 24)) % MOD; printf("%d\n", r); return 0; }