func main() {
    let s = readLine()!
    let t = readLine()!
    if s == String(t[t.startIndex...t.index(t.startIndex, offsetBy: s.count - 1)]) {
        print("Yes")
    } else {
        print("No")
    }
}

main()
