#include #include using namespace std; int main() { string s1,s2; cin >> s1 >> s2; int flag=1; for(int i=0; i s2[i]) { break; } else if(s1[i]==s2[i]) { continue; } else { flag=0; break;} } if(flag==0) { cout << "NO" << endl; } else if(flag==1) { cout << "YES" << endl;} return 0; }