import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Comparator; import java.util.Deque; import java.util.HashMap; import java.util.PriorityQueue; import java.util.StringTokenizer; class Main{ static final PrintWriter out=new PrintWriter(System.out); static final int INF=Integer.MAX_VALUE/2; static int[] dx={-1,0,1,0}; static int[] dy={0,-1,0,1}; public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; while((line=br.readLine())!=null&&!line.isEmpty()){ StringTokenizer st=new StringTokenizer(line); int n=Integer.parseInt(st.nextToken()); int m=Integer.parseInt(st.nextToken()); int c=Integer.parseInt(st.nextToken()); boolean[][] visited=new boolean[n][m]; if(dfs(c%m==0?c/m-1:c/m,c%m==0?m-1:c%m-1,visited,c,n,m)) out.println("YES"); else out.println("NO"); out.flush(); } } private static boolean dfs(int a,int b,boolean[][] visited,int c,int n,int m){ if(m*a+b+1==c){ if(check(visited,n,m)) return true; else return false; } visited[a][b]=true; for(int i=0;i<4;i++){ int na=a+dx[i]; int nb=b+dy[i]; if(na>=0&&nb>=0&&na DISTANCE_ORDER=new DistanceOrderComparator(); static class DistanceOrderComparator implements Comparator{ public int compare(Node n1,Node n2){ return (n1.d>n2.d)?1:(n1.d