#include #include #include int main() { char line[200]; int all_before(char *, char, char); while (gets(line) != NULL) { char a, b, str[200]; int res; strcpy(str, line); gets(line); a = line[0]; b = line[2]; res = all_before(str, a, b); puts(res ? "YES" : "NO"); } return EXIT_SUCCESS; }