import Foundation
 
let input_line: String = readLine()!
let split: [String] = input_line.components(separatedBy: " ")
 
let S = String(input_line)
let T = String(input_line)
var x = String(input_line)


if (String("T").dropLast()=="S"){
    print("Yes")
}else{
    print("No")
}

