import 'dart:io';

void main() {
  List<String> s = stdin.readLineSync().split('');
  List<String> t = stdin.readLineSync().split('');
  List<bool> check = [];

  for (int i = 0; i < s.length; i++) {
    if (s[i] == t[i]) {
      check.add(true);
    }
  }
    if(check.length == s.length) {
      print('Yes');
    } else {
      print('No');
    }
}
