intmain(){ scanf("%d %d", &n, &m); for (int i = 0; i < n; ++i) scanf("%d", &a[i]); for (int i = 0; i < m; ++i) scanf("%d", &b[i]); int i = 0, j = 0; while (j < m && i < n) { if (a[i] == b[j]) i++; j++; } printf("%s", (i == n ? "Yes" : "No")); return0; }