#include <bits/stdc++.h>
using namespace std;

int main() {
	string str1, str2;
	cin >> str1 >> str2;
	bool same = true;
	const int n = str1.size();
	
	for(int i = 0; i < n; ++i) {
		if(str1[i] != str2[i]) {
			same = false;
			break;
		}
	}
	
	if(same) {
		cout << "Yes";
	} else {
		cout << "No";
	}
}

