#include<iostream> using namespace std; int main() { int i, j,n; string s1, s2,a1,a2; cin >> i >> j; cin >> s1 >> s2; a1 = s1[i-1]; a2 = s2[i-1]; for (n = i-1; n < j; n++) { a1 += s1[n]; a2 += s2[n]; } if (a1 == a2) cout << "yes" << endl; else cout << "no" << endl; return 0; }