#include <iostream>
#include <algorithm>
#include <map>
#include <vector>
#include <utility>
#include <limits>
 
template<int Size = 1000000, typename WeightType = int>
class WeightedUnionFind {
    int par[Size], rank[Size], sizes[Size];
    WeightType wei[Size];
    
public:
	WeightedUnionFind() = default;
	WeightedUnionFind(const WeightedUnionFind&) = default;
	WeightedUnionFind(WeightedUnionFind&&) = default;
	WeightedUnionFind& operator = (const WeightedUnionFind&) = default;
	WeightedUnionFind& operator = (WeightedUnionFind&&) = default;
 
    WeightedUnionFind(int size) {
		init(size);
	}
 
	void init(int size) {
        for(int i = 0; i < size; ++i) {
            par[i] = i;
            rank[i] = 0;
            sizes[i] = 1;
            wei[i] = 0;
        }
    }
    
    int find(int x) {
        if(par[x] == x) {
            return x;
        }else {
            int p = find(par[x]);
            
            wei[x] += wei[par[x]];
            
            return par[x] = p;
        }
    }
    
    WeightType weight(int x) {
        find(x);
        
        return wei[x];
    }
    
    void unite(int x, int y, WeightType w) {
        w += weight(x); 
        w -= weight(y);
        x = find(x);
        y = find(y);
        
        if(x == y) return;
        
        if(rank[x] < rank[y]) {
            par[x] = y;
            sizes[y] += sizes[x];
            wei[x] = -w;
        }else {
            par[y] = x;
            sizes[x] += sizes[y];
            wei[y] = w;
            if(rank[x] == rank[y]) ++rank[x];
        }
    }
    
    bool same(int x, int y) {
        return find(x) == find(y);
    }
    
    int size(int x) {
        return sizes[find(x)];
    }
    
    WeightType diff(int x, int y, WeightType disabledVal = static_cast<WeightType>(-1)) {
        if(!same(x, y)) {
            return disabledVal;
        }
        
        return weight(x) - weight(y);
    }
};
 
using P = std::pair<long long, long long>;
using PP = std::pair<P, long long>;
constexpr long long INF = std::numeric_limits<long long>::max();
 
int r, c, n;
PP arr[100010];
 
bool func() {
    std::vector<long long> minVal(1000000, INF);
    WeightedUnionFind<1000000, long long> uf(c + 100);
 
    for(int i = 0; i < n; ++i) {
        minVal[arr[i].first.second] = std::min(minVal[arr[i].first.second], arr[i].second);
 
        if(i == 0 || arr[i - 1].first.first != arr[i].first.first)
            continue;
        
        if(uf.same(arr[i - 1].first.second, arr[i].first.second) && uf.diff(arr[i].first.second, arr[i - 1].first.second) != arr[i].second - arr[i - 1].second) {
            return false;
        }
 
        uf.unite(arr[i - 1].first.second, arr[i].first.second, arr[i].second - arr[i - 1].second);
    }
 
    std::map<long long, long long> minPos, minDiff;
 
    for(int i = 0; i < c; ++i) {
        if(minVal[i] == INF)
            continue;
 
        auto p = uf.find(i);
        auto d = uf.diff(i, p);
        
        if(minPos.count(p)) {
            minPos[p] = std::min(minPos[p], minVal[i] - d);
            minDiff[p] = std::min(minDiff[p], d);
        }else {
            minPos[p] = minVal[i] - d;
            minDiff[p] = d;
        }
    }
 
    for(auto mp = minPos.begin(), md = minDiff.begin(); mp != minPos.end(); ++mp, ++md) {
        if(mp->second + md->second < 0) {
            if(mp->second + md->second < mp->second && md->second > 0) {
                abort();
            }
//            abort();
            return false;
        }
    }
 
    return true;
}
 
int main(){
    std::cin >> r >> c >> n;
 
    for(int i = 0; i < n; ++i) {
        std::cin >> arr[i].first.first >> arr[i].first.second >> arr[i].second;
        --arr[i].first.first;
        --arr[i].first.second;
    }
 
    std::sort(arr, arr + n);
    if(!func()) {
        std::cout << "No" << std::endl;
        
        return 0;
    }else {
        std::cout << "Yes" << std::endl;
        return 0;
    }
 
    std::swap(r, c);
 
    for(auto&& p : arr) {
        std::swap(p.first.second, p.first.first);
    }
 
    std::sort(arr, arr + n);
 
    if(!func()) {
        std::cout << "No" << std::endl;
    }else {
        std::cout << "Yes" << std::endl;
    }
}

Measured memory_bytes: 24832