#include <bits/stdc++.h>
using namespace std;
using namespace chrono;
int setBit(int n, int x) { return n | (1 << x); }
int clearBit(int n, int x) { return n & ~(1 << x); }
int toggleBit(int n, int x) { return n ^ (1 << x); }
bool checkBit(int n, int x) { return (bool)(n & (1 << x)); }
int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy8[] = {0, 1, 1, 1, 0, -1, -1, -1};
int dx4[] = {1, 0, -1, 0};
int dy4[] = {0, 1, 0, -1};
void yes() { cout << "YES" << endl; }
void no() { cout << "NO" << endl; }
template <typename T>
void amax(T& t1, T t2) {
  t1 = max(t1, t2);
}
template <typename T>
void amin(T& t1, T t2) {
  t1 = min(t1, t2);
}
void _print(long long t) { cerr << t; }
void _print(int t) { cerr << t; }
void _print(string t) { cerr << t; }
void _print(char t) { cerr << t; }
void _print(long double t) { cerr << t; }
void _print(double t) { cerr << t; }
void _print(unsigned long long t) { cerr << t; }
template <class T, class V>
void _print(pair<T, V> p);
template <class T>
void _print(vector<T> v);
template <class T>
void _print(set<T> v);
template <class T, class V>
void _print(map<T, V> v);
template <class T>
void _print(multiset<T> v);
template <class T, class V>
void _print(pair<T, V> p) {
  cerr << "{";
  _print(p.first);
  cerr << ",";
  _print(p.second);
  cerr << "}";
}
template <class T>
void _print(vector<T> v) {
  cerr << "[ ";
  for (T i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
template <class T>
void _print(set<T> v) {
  cerr << "[ ";
  for (T i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
template <class T>
void _print(multiset<T> v) {
  cerr << "[ ";
  for (T i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
template <class T, class V>
void _print(map<T, V> v) {
  cerr << "[ ";
  for (auto i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
long long binpow(long long a, long long b, long long m) {
  long long ans = 1;
  a %= m;
  while (b) {
    if (b & 1) ans = (ans * a);
    b /= 2;
    a = (a * a);
    ans %= m;
    a %= m;
  }
  return ans;
}
struct cmp {
  bool operator()(pair<long long, long long> a, pair<long long, long long> b) {
    return ((a.first - a.first / 2) * a.second) >
           ((b.first - b.first / 2) * b.second);
  }
};
void JAI_MAHAKAL() {
  long long n, m, k;
  cin >> n >> m >> k;
  if ((n & 1) != (m & 1) and k == -1) {
    cout << 0 << endl;
    return;
  }
  long long x = binpow(2, n - 1, 1000000007);
  long long ans = binpow(x, m - 1, 1000000007);
  cout << ans << endl;
  return;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) JAI_MAHAKAL();
  cerr << "Time elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
  return 0;
}
