#include #define NUM 3 int main() { int box1[NUM]; int box2[NUM]; int tem = 0; int i, j;//, k=1; for(i = 0; i < NUM; i++) { scanf("%d", &box1[i]); } for(i = 0; i < NUM; i++) { scanf("%d", &box2[i]); } if((box1[0] == box1[1])&&(box1[0] == box1[2])&&(box1[1] == box1[2])) { printf("No\n"); return 0; } else if((box2[0] == box2[1])&&(box2[0] == box2[2])&&(box2[1] == box2[2])) { printf("No\n"); return 0; } else { for(i = 0; i < NUM; i++) { for(j = 0; j < NUM; j++) { //printf("tem:%d box1[i]:%d box2[j]:%d\n", tem, box1[i], box2[j]); tem = box1[i]; box1[i] = box2[j]; box2[j] = tem; //printf("tem:%d box1[i]:%d box2[j]:%d\n", tem, box1[i], box2[j]); //printf("%d %d %d\n", box1[0],box1[1],box1[2]); //printf("%d %d %d\n", box2[0],box2[1],box2[2]); if((box1[0]!=box1[1])&&(box1[0]!=box1[2])&&(box1[1]!=box1[2])&&(box2[0]!=box2[1])&&(box2[0]!=box2[2])&&(box2[1]!=box2[2])){ if((box1[1] > box1[0]) && (box1[1] > box1[2])) { if((box2[1] > box2[0]) && (box2[1] > box2[2])) { printf("Yes\n"); return 0; } } else if((box1[1] > box1[0])&&(box1[1] > box1[2])) { if((box2[1] < box2[0])&&(box2[1] < box2[2])) { printf("Yes\n"); return 0; } } else if((box1[1] < box1[0]) && (box1[1] < box1[2])) { if((box2[1] > box2[0]) && (box2[1] > box2[2])) { printf("Yes\n"); return 0; } } else if((box1[1] < box1[0])&&(box1[1] < box1[2])) { if((box2[1] < box2[0])&&(box2[1] < box2[2])) { printf("Yes\n"); return 0; } } else { } } //printf("tem:%d box1[i]:%d box2[j]:%d\n", tem, box1[i], box2[j]); tem = box1[i]; box1[i] = box2[j]; box2[j] = tem; //printf("tem:%d box1[i]:%d box2[j]:%d\n", tem, box1[i], box2[j]); //printf("%d %d %d\n", box1[0],box1[1],box1[2]); //printf("%d %d %d\n", box2[0],box2[1],box2[2]); //printf("%d\n", k); //k++; } } } printf("No\n"); return 0; }