#include <bits/stdc++.h>
using namespace std;
const long long int M = 1e9 + 7;
const long double INF = 1e18;
const int inf = 2e9;
const int N = 1e5 + 5;
const double eps = 1e-10;
const double PI = 3.14159265;
long long int fun(long long int a, long long int b) {
  long long int res = 1, tp = a;
  while (b) {
    if (b & 1LL) res = (res * tp) % M;
    tp = (tp * tp) % M;
    b >>= 1LL;
  }
  return res;
}
void solve() {
  long long int n, m, k;
  cin >> n >> m >> k;
  if ((n + m) & 1 && k == -1)
    cout << 0;
  else
    cout << fun(fun(2LL, n - 1), m - 1);
  return;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
