#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;

int main() {
	string S, T;
	bool key = true;

	cin >> S >> T;
	
	for (int i = 0; i < S.size(); i++) {
		if (S[i] == T[i]) continue;
		else { key = false; }
	}

	if (key) { cout << "Yes"; }
	else { cout << "No"; }
	
	return 0;
}