#!usr/bin/env python3 from collections import defaultdict, deque from heapq import heappush, heappop from itertools import permutations, accumulate import sys import math import bisect def LI(): return [int(x) for x in sys.stdin.readline().split()] def I(): return int(sys.stdin.readline()) def IR(n): return [I() for _ in range(n)] def LIR(n): return [LI() for _ in range(n)] sys.setrecursionlimit(1000000) mod = 1000000007 def main(): n,m,l = LI() st = LIR(l) fs = [0]*(n+1) ft = [0]*(m+1) for s,t in st: fs[s] += 1 ft[t] += 1 a = sum(i>=1 for i in fs) b = sum(i>=1 for i in ft) m = min(a,b) for s,t in st: a_ = a-(fs[s]==1) b_ = b-(ft[t]==1) m_ = min(a_,b_) print(["Yes","No"][m != m_]) return if __name__ == "__main__": main()