/*******************************************************************************************************************************************************************************************************************************************************************
********************************************************************************************************************************************************************************************************************************************************************

                                                                                                                                                                                                                                                                `
                                                                                                                                                                                                                                                                   `
                                                                                                                                                                                                                                                                   `
                                                                                                                                               .:!|%|;'.                                                                                                           `
                                                                                                                                             ;&#&!'..|##&:                                                                                                         `
                                                                                                                  ...                      '$@@;  .`. `%@%:                                                                                                        `
                                                                                                                :%@#%`                    '&#%'.`''''..;%&!                                                                                                        `
                                                                                                              .%#%:|&!                  `%#|`..'''`''`.:|$!                                                                                                        `
                                                                                                             `|$|. .!|:                :%@&:.`'`. .`'`.:|&|.                                                                                                       `
                                                                                                            `|@|`...:$$'              :$#&!``':.  .`'`.;%&|.                                                                                                       `
                                                                                                           '$@$'.''``|#&;.           |##%'.':'.   .`'`.:%&%.                                                                                                       `
                                                                                                           !@%:``'''`:$#@;.         ;@#%'``'`     .`'`.'|@$.                                                                                                       `
                                                                                                          `%$:.`'''''``!&#&'   .;%&##|```''.      .`'`.'!@&'                                                                                                       `
                                                                                                          '%%'.`'''''```:$#&|%$@#@$!'..`''`       .''```;&&'                                                                                                       `
                                                                                                          :%|'.`''''''```:|@#&$;'``.``'''`        .`'```:&&:                                                                                                       `
                                                                                                         :$&|'.`'''''''''``....`''''''''`         .`''`.`%$;                                                                                                       `
                                                                                                      .'|@#%:``'''``''''''''`''''``''''`.         .`''`.`!$|`                                                                                                      `
                                                                                                     ;&##$!'``''''''''''''''''''`''''''`.         .`''`.`;$$:.                                                                                                     `
                                                                                                 '!&#@|'...'''''''''''`''''''''''''''''''::`      .`'''```!$|`                                                                                                     `
                                                                                               :&##@%'..`''''''''''''''''''''''''''''''''''''.    .''''```;&&:                                                                                                     `
                                                                                           '|@#@|'. .':'''''''''''''''''''''''''''''''``'''''''...`'''''`.'$#|`                                                                                                    `
                                                                                       .';|@#&|' .`'''``'`''''''''''''''''''''''''''''''''```'''''''''''`.`%@$;                                                                                                    `
                                                                                .`':!%$&&&$;'`.`'''''```''`..``'''''''''''''''''''''''''''''''`''''''''''``!&#$`                                                                                                   `
                                                                 ...`':;!||%$&@###&%!'.   .`:'''''``.;%$$$&&%!'``''''''''''''''''''''''''''''''''''`''''''`'!&#|.                                                                                                  `
                                                             '|$&&&@@#@@&&&&$%|;'`...```'''''''''``'!%!'`:%###@!```'''''''''''''''''''''''''''''''''''''''``'|@&|`                                                                                                 `
                                                            `|#######$'...    .``'''''''''''''''`';$&: `!$#####&!'``'''''''''''''''''''''''''''''''''''''''`.:%##%:                                                                                                `
                                                            '%###@@&|`                    .``'''`'!$&: '$@#####|'```''''''''''''''''''''''''''''''''''''''''`.`%##@%'                                                                                              `
                                                            '%#%'``.                          .`'``:||;;|@##&%;`.`'''''''''''''''''''''''''''''''''''''''''''`.;$###$`                                                                                             `
                                                            `|@!                                .':'``'''`....`''''''`.``''''''''''''''''''''''''''''''''``''''`.;$##&!.                                                                                           `
                                                            .!@|.                                 `':'``````''''''`.      .`'''''''''''''''''''''''''''''''''''``.:%@#@!`                                                                                          `
                                                             ;@%`                                   `':'''''`''''.          .''''''''''''''''''''''''''''''''''''`.`;@##|`                                                                                         `
                                                             :&&;.                                    `''::'''''`             .''''''''''''''''''''''''''''''''''''`.:$@@%'                                                                                        `
                                                             `|&&;                                       ..``'''.              .`'''''''''''''''''''''''''''''''''''`.'%@@|.                                                                                       `
                                                              `$#&;.                                                             .`''''''''''''''''''''''''''''''''''..:%@$`                                                                                       `
                                                               :@##$;.                                                             .`''''''''''''''''''''''''''''''`````;&@:                                                                                       `
                                                               `%####|`                                                               ..``'''''''''''''''''''''''''''``.:$&;.           `'::''``.                                                                  `
                                                                 `%@####@%!`                                                              .`'''''''''''''''''''''''''``.'|&%'        :%&&$$$$$&&@&&&%!:`             .``.                                          `
                                                                  .!&######@&$$%||!!!!;:'.                                                .`''''''''''''''''''''''''''`.'|&$;.     .:%$%|!!|||||||%%$&&$%!;:''::;;!!|$$!'                                          `
                                                                    `|####&;':;!|||||!:`.                                                .``'''''''''''''''''''''''''``.'!&$;.    :|$||||||||||||||||||%%%%%%%$$%%%|%$%'                                           `
                                                                      `!&##@%;`                                                     .`''''''''''''''''''''''''''''''''`.`!$&!. .;$&$%|%%%%||||||||||||||||!!!!!!!!!%$!'                                            `
                                                                        .:!&##@%:`.                                                .''''''''''''''''''''''''''''''''''`.`;$&|'`|@@@&&&&@&&&$$%%||||||||||||!!!!!!|$$|`                                             `
                                                                           `:|&##@$%!'                                            .`'''''''''''''''''''''''''''''''```'':|$@&$%$$$&@@@&&@@@@@@&$%||||||!!!!!!!!%$&$!'                                              `
                                                                               '%@####@%;.                                       .`''''''''''''''''''''''''''''````';%&@@@@@@&$|!|%&&$%|||%$&@@@&$%|||||||||%$&&%;.                                                `
                                                                                 `:|&####$;.                                     `'''''''''''''''''''''''''''```:;|$&@&$%%%&@@&%||%&&$%|||||%%$@@@&$%%$$&&@@@@$;.                                                  `
                      .:!|!'                                                         `!%&@@%;::;:'.                             .''''''''''''''''''''''''```':!$#@&$%|!||||$&@&%||%&&%||!||||||%$$&@@@&%|;:`                                                       `
                    ;$@##@@##|.                                                       '|&$$$%%%$$%%|!;:''`.                     `'''`''''''''''''''''`'''':!%$&&$%|||||||||$&@@%||%&&%||||||||||||%$&&%:.                                                          `
                  '$#@|.   .|#&:                                                       :%&$|!!!!|||%%%$$%%%|!!;'`.             .'''''''''''''''''````':!|%$&&$%%|||||||||||%&@&%||%$$%||||||||||||||%&&%:.                                                         `
                 '$#%`      .|#&'         .....                                         .|@$|!!!!!!!!!!!!|||%%$$$$$$%!:'`.      `'``````````````'':!|$&&&$%||||||||||||||||%$@#@@@@#@$%%|||||||||||||||$&&|`                                                       `
                .|@@!        :&@;                                                      `!%$&&$%|!!!!!!!!!!!!!!!||||%%$$$$%|!:''::::::::::;;;!!!!|%%$$$%|||||||||||||||||%%%$&&$%%%%%&@@$$%||||||||||||||%%$%!'.                                                    `
                `%#&:        .|##$;`.      ...                   :!%%%%%$$$%%%%$&@@@@@####@&@&$%!!!!!!!!!!!!!!!!!!!!!||%%%%$$$$$$$$$$$$$$$$$$$%%%%|||||||||||||||||%%%$$&&&|;;;;::::;%@@@&$%|||||||||||||||%%%|!;:':;;'.                                           `
                '$#|.          :$@###########################@@&@@@@@&&$$$$$$$$$%%$$&$$$&&%|%&&$||!!!!!!!!!!!!!!!!!!!!!!!!||||||||||%%%||||||||||||||||||||||||%$$&&&&&&$!:'''':!;;::';%@@&%|||||||||||||||!!||%$&@@%'                                             `
                '&#!.                   ...``````'''''''`'''';!%&&|''''''''''''''''''''''::::%&$%%|!!!!!!!!!!!!!!!!!!!!!!!!||||||||||||||||||||||||||||||||%%$&&&$$&&&%!:'``''':::::'``;%&@$%||||||||!||||||%$&@&%!'.                                              `
                .%#$'                                          ;&@|:''''''''''''''''''''''''';%$$%%|!!!!!!!!|||!!!!!!!!!!||||||||||||||||||||||||||||||%$$&@@@&$$&@&|:';!;:''''::''''''';$&&&&$$%%%%%%%$$$&@@&%'                                                   `
                '$#@|`                                         ;&@|:''''''''''''''''''''''''':!$&$%%|!!!!!!!!!!!!!!!!!!!!!!||||||||||||||||||||||||%%$$&&&&&&&&&&$|;::::::::'''''''''''`';%&@&&&&&&&$&&@&&&@#&:                                                    `
             `';;%@#@%`                                        ;&@|:'''''''''''''''''''''''''':%@&$$%|!!!!!!!!!!!!!!!!|||||||||||||||||||||||||%%$$&&&&$$$$&&$$|;:'``''''''::''''''''''``.';!!!!!!;;:;:'`.`!&@|`                                                   `
            `:;;;:;!$@#@%;`                                    :&@|:'''''''''''''''''''''''''``;%&&$$%|!!!!!!!!!!!!!!!|||%%%$$$$$$$$%%%%%%$$$&&&&&&$$%%$&@&%%@#$!!;:`'''''''''''''''''''''`''''''''''''':!$@##&`                                                   `
            .':;;;;:::!%&###@&|'                              .!@@|:''''''''''''''''''''''''''`';%&&&$%||!!!!!!!!!!!!!!!!||||%%%$$$$$$$$$$&&$$$$%%||%&&&$%%%$@#@$%&&@#$!:''''''''''''::::'::::::::::!$@#####@;                                                     `
            .`::;;;;;:::::;!%$@##@@%;.                         ;@@|'''''''''''''''''''''''''''''';%&@&$$%||!!!!!!!!!!!!!!!!!!||||||||%%%%%%%%||||%$&&$$$$$$$$@#@%!;%@@@#@&|:'''''::::'''':::::;!%&@###&|;|&#$`                                                     `
            .'::;;;;;;;:::::::::;|&@###@$|:`                   :&@|:''''''''''''''''''''''''::':;%@@@@@&$$%|!!!!|!!!!!!||!!||||||||||||||||||||%&&&&$$$$$$$%$@#@%!;!$#####@#&!''::''''':;|&@######&;.     !#$`                                                     `
            .'::;;;;;;::::::::::`     '!$@####@&%;`.           ;&@%:''''''''''''''''''''''''''':!%$$$&&&&&$%%||!!!!!!!!|||||||!|||||||||||||||%&@&$&&$$$$$$%$@#@|;;|$@@; `|&##@&|::;|$&@####$;`          `|@%`                                                     `
            .'::;;;;;;:::::::::::'`.         `'!$@###@@&%;`   .!@#$;'''''''''''''''''''''''':'';%&@&$$$&&&&&$$%%|!!!!||!!!|||||||||||||||||||$@&&&$$$$$$$$$%$@#&!::!%@@|.     :&#######@%;.              `$@!                                                      `
            .':::;;;:;;;:::::::::'``...             `!$@@####@@@@#$:'''''''''''''''''''''''':'';%@@$$$$$$$$&&&&$%%|||!!||||||||||||||||||||$&&&&#@$$$$$$$$%$&##$!:';%&#%.       '$@@|.  .                |#$`                                                      `
            `':::;;;;;::::::::::''```..  ...              .'!|&###%:'''''''''''''''''''''''''''!&#@$$$$$$%%&@@&@@&$%%|||!|||||||||||||||||%&&%!$#@$$$$$$$$%$&##$!:';%@@;         !@&:                   ;@&;                                                       `
            `':::;::;;;:::::::''''``....                       !@#%:'''''''''''''''''''''''''''!&@&$$$$$$$$@&|:!%&&@&$%%|||||||||||||||||$&$!``%#&$$$$$$$$$$&##$!:':|@@;        ;@@;                   !@&;                                                        `
            `':::;;;;;::::::::'''```.. .                       `$#&;'''''''''''''''''''''''''''|@#&$$$$$$$&@$;''':;|$&&$$%%||||||||||||%&@$;'';$#&$$$$$$$$$$&##$;'':|@@;       !@@;                  '&#&:                                                         `
            `''::::::::::::::''''``...                          `$#@&%|;::::::::::::::::'''''':%##&$$$$$$$$@&;'':''':!$&&&$$%||||||%%$&&%;'''';&#&$$$$%$$$$$@##$;:':|@&:      !@@;                  ;@#$'                                                          `
            `''::::::::::::::''''``...                            :$##@@@@@@@@&&&&&&&@&&$%|!;:;$##&$$$$$$$$&|'':::''''';%&&$$$$%%%$&&%!:''''''!&#&$$$$$$$$$$&##%;:':|@&'    `$#$`                 .|#@!                                                            `
            .`''::::::::::::''''````..                               .....';|%$&@@@@@@@####@$|!&#@$$$$$$$$$&!''::''''''':|$&&$$&@&$!;:'''''''';$#&$$$$$$$$$%&##%:'':%@@:   :&@;                  ;&#$`                                                             `
            .``'':::::::::''''''```...                                                 '%###$|!&#@$$$$$$$$$$!''::''''''''`'|&@#$;'`''''''''''';$#@$%%$$$$$$$&#@|:'':%@&'  !@&:                `|@#|.                                                               `
            .``'''::::::::'''''```...                                                   :&#@$||@#&$$$$$$$$&&!''''''''''''''':;;''''''''''''''';$#@$$%$$$$$$$&#@|:':;%@#$%&#%.               `%@#$'                                                                 `
            ..``'''''::::''''''``....                                                   '$#@%%%@#&$$$$$$$$&&|'':'''''''''''''''''''''''''''''':%#@$$%%$$$$$$&#@|;!|$@####&:               `%@#&:                                                                   `
            ..```''''''''''''````...                                                    `%#&%%$@#&$$$$$$$$&@|'':'''''''''''''''''''''''''''''':%#@$$%%$$$$$$@#@$$&##@!.                 .|@#@!                                                                     `
             ..```''''''''``````...                                                     `%#&||$##&$$$$$$$$&&|:'''''''''''''''''''''''''''''''':$#@$$%%$$$$%$@##@##&:                  .|@#@;                                                                       `
             ...``````````````...                                                       `$@&|%&##&$$$$$$$$&@|''''''''''''''''''''''''''''''''';$#@$$$$%$$%%&####&;                  .|@#$'                                                                         `
              ....`````````.....                                                        '$@$|$&##&$$$$$$$$&@|''''''''''''''''''''''''''''''''';&#@$$$$%$$$$$&##@!                 .|@#$`                                                                           `
                ...............                                                         ;&@$|$@#@$$$$$$$$$&@%:'''''''''''''''''''''''''''''''';&#@$$$$$$$$$$&##&:        `      .|@#|.                                                                             `
                   .......                                                              !@@%|&##@$$$$$$$$$@@|''''''''''''''''''''''''''''''''';&#&$%%$$$$$$$&##@!.        .```.`:$@#%.                                                                             `
                                                                                       .|#&%|&##&$$$$$$$$$@&;''''''''''''''''''''''''''''''''':$#&$%%$$$$$$%&##@;               `|@@|                                                                              `
                                                                                       '$#&||&##&$$$$$$$$&@$:''''''''''''''''''''''''''''''''':%@&$%%$$$$$$%&###&;           ...`!@#%.                                                                             `
                                                                                       ;&@$!|&##&$$$$$$$$&#$:''''''''''''''''''''''''''''''''':$#&$$$$$$$$%$&#####$:             ;@#&`                                                                             `
                                                                                       !@@%;|&#@$$$$$$$$$&#$:''''''''''''''''''''''''''''''''':$#&$$$$$$$$$$@##&%%@######@$||$&@##$'                                                                               `
                                                                                       !@@|;|&#&$$$$$$$$$&#$:''''''''''''''''''''''''''''''''':%#@$$$$%$$$$$@#@|:'':;%@&&&@@@&%!'                                                                                  `
                                                                                       !@@!:|@#&$$$$$$$$$@#%:''''''''''''''''''''''''''''''''''|@@$$$$$$$$$$@#@!:''``|@;                                                                                           `
                                                                                       !&%::|&#@$$$$%$$$$@#|'''''''''''''''''''''''''''''''''':%##$$$$$$$$$&@#@|:::``%@!                                                                                           `
                                                                                       `''``:!|%$%|!!!!!||%|;''`..````.````````````````''''''';|%%||!!;;!!|%%%|:`   .%@!                                                                                           `
                                                                                                                                                                                                                                                                   `
                                                                                                                                                                                                                                                                   `
                                                                                                                                                                                                                                                                   `
                                                                                                                                                                                                                                                                   `
                                                                                                                                                                                                                                                                   `
                                                                                    .                                                                             .`.                                                                                              `
                                                         ......:!:. ...           `|$'         `%|'!%!;|%$$$$$$:    `|$%%$$$$$$%$$%'   :$%%%%%%$$$%%$$%$|.        :$$;;;;;'                         .!%`   .........                                               `
                                                        ':;!!!|$%!!!!!;'.  `|%|!!!|%$%!!!!|!.  .:$@$;.    '%$;`     '%|'`.`%@;.`'%&:    .     `|%:     ..    ````';&$:':::'`.                        ;|`  :%$&&$%%&@!                                              `
                                                          .;!::;;:':|!.    '&$;::'. `;!'..;|`  ;%%%!;;|%%%$&%%%|;`  '%%;:':$@!':;$&:         `||'.          '$$;:;|$%;;!!:!%;.                      .;|'``. .!!.  :&!                                              `
                                                          `%@&&&&&&&@$`      ..'!%%:`;;`       ..`;$%`  .`!!`       `|!'``'%&;``'%&:       `;|&%`:%%;.      `$&|%$&@&|;;:`'`                      `%&&$!;;` .%%. `;%:                                              `
                                                          `||::''':;%%`      :%!'`` `!:         .;&#$` `:$&;...      ':'::|%!:::::'.     .:%|':|`  :|!'     '%%. .'!|:'';|!.  .!$%%%%%%%%%%%%%%!`    ;!.    `$%. `;!'                                              `
                                                          `%@&&&&&&&@%`    `;;;!!;'`:%!'`'':'  ;&%;$$;%|!$&%%!!!.  .:%$%%$&@&$%%%$%!'  :%$%'  '!'   .|&|'  .:|!.  `||:!!'.                           :!..;:`;$!  `;!'                                              `
                                                       `::;|!;:::::;|%;:;` .`''''':%&|;:'''``  ''.`%$!$!`$%!&;'!`    .. `;%!. ...;%!'  `'.    '!'     .    '!!;!|''$|'!;':!;.                       .|&$|!:|$;.  `;!'                                              `
                                                        .``;%%!'.'!%$!:`.      `:!||:'!%%!:.     '|%|!&|:$$|&!;|:     .'!$%`     !&;.         '!'          !&:.:|:'&|'!;:;;`                        .;;``:||:  .:%$;`                                              `
                                                       .:$&!'.     .`!@%'  '$@@$!'.     `!$%'  '$#&;'|%%|%%%%||%|' ;$&&%!`    .%@&%'          :|'         '%%`'&#@@##@@@@@@#$`                         `|@%.  .%@$;.                                               `
                                                                                                                                                                                                                                                                   `
                                                                                                                                                                                                                                                                   `
                                                                                                                                                                                                                                                                   `
                                                                                                                                                                                                                                                                   `
                                                                                                                                                                                                                                                                   `
********************************************************************************************************************************************************************************************************************************************************************
*******************************************************************************************************************************************************************************************************************************************************************/
/*********************
*@Author:   CKang    *
*@Language: C++11    *
*********************/
#include<bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
//#define DEBUG
#define RI register int
#define endl "\n"

using namespace std;

typedef long long ll;
//typedef __int128 lll;
//const int N=100000+10;
const int M=100000+10;
const int MOD=1e9+7;
const double PI = acos(-1.0);
const double EXP = 1E-9;
const int INF = 0x3fffffff;
const ll LINF = 0x3fffffffffffffff;

inline ll read(){
    long long x=0,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9'){
        if(ch=='-')
            f=-1;
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        x=(x<<1)+(x<<3)+(ch^48);
        ch=getchar();
    }
    return x*f;
}

void solve(){
    string s,t;
    cin>>s>>t;
    for(int i=0;i<s.length();i++){
        if(s[i]!=t[i]){
            puts("No");
            return ;
        }
    }
    puts("Yes");
    return ;
}

int main()
{
#ifdef DEBUG
    freopen("input.in", "r", stdin);
    //freopen("output.out", "w", stdout)
#endif
    //cout.tie(0);
    //for(ll t=read();t;t--)
        solve();
#ifdef DEBUG
    printf("Time cost : %lf s\n",(double)clock()/CLOCKS_PER_SEC);
#endif
    //cout << "Fuck You !" << endl;
    return 0;
}


Measured memory_bytes: 3628