intmain(){ cin >> n >> m; for (int i = 0; i < n; i++) { cin >> a[i]; } for (int i = 0; i < m; i++) { cin >> b[i]; } int ok = 1; for (int i = 0, j = 0; i < n; i++, j++) { while (j < m && a[i] != b[j]) j++; if (j >= m) { cout << "No" << endl; ok = 0; break; } } if (ok) cout << "Yes" << endl; return0; }