#include <iostream>
#include <stdio.h>
#include <string>

int main()
{
    std::string S, T;

    int x;

    std::cin >> S >> T;

    for(int i = 0; i < S.length(); i++)
    {
        if(S[i] != T[i])
        {
            x = -2;
        }
    }

    if(x == -2)
        printf("No\n");
    else
    printf("Yes\n");

    return 0;
}