#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long n, m, k;
long long P(long long base, long long st) {
  if (st == 0)
    return 1;
  else if (st == 1)
    return (base % MOD);
  else {
    long long t = P(base, st / 2);
    long long pr = (t * t) % MOD;
    if (st % 2 == 0)
      return pr;
    else
      return (pr * base) % MOD;
  }
}
int main() {
  cin >> n >> m >> k;
  if (k == -1) {
    if ((n % 2 == 0) != (m % 2 == 0)) {
      cout << 0;
      return 0;
    }
  }
  long long one = P(2, n - 1);
  long long two = P(one, m - 1);
  cout << (two % MOD);
  return 0;
}
