#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod = 1532023;

int main(){
    freopen("TONGBANG.INP", "r", stdin);
    freopen("TONGBANG.OUT", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    ll m, n;
    cin >> m >> n;
    ll sc = m * n;
    if (sc % 2 == 0) sc--;
    ll ssh = (sc - 1) / 2 + 1;
    ll s = (((1 + sc) / 2 % mod) * (ssh % mod)) % mod;
    if (n % 2 == 1) {
        cout << s;
    } else {
        cout << (s + ((m / 2) * (n / 2) % mod)) % mod;
    }
}
