import
java.util.*;
class
GFG{
static
void
convertString(String str1,
String str2,
String str3)
{
HashMap<Character,
Integer> freq =
new
HashMap<>();
for
(
int
i =
0
; i<str3.length(); i++)
{
if
(freq.containsKey(str3.charAt(i)))
freq.put(str3.charAt(i),
freq.get(str3.charAt(i)) +
1
);
else
freq.put(str3.charAt(i),
1
);
}
int
ptr1 =
0
;
int
ptr2 =
0
;
boolean
flag =
true
;
while
(ptr1 < str1.length() &&
ptr2 < str2.length())
{
if
(str1.charAt(ptr1) == str2.charAt(ptr2))
{
ptr1++;
ptr2++;
}
else
{
if
(freq.containsKey(str3.charAt(ptr2)))
if
(freq.get(str3.charAt(ptr2)) >
0
)
{
freq.put(str3.charAt(ptr2),
freq.get(str3.charAt(ptr2)) -
1
);
ptr2++;
}
else
{
flag =
false
;
break
;
}
}
}
if
(flag && ptr1 == str1.length() &&
ptr2 == str2.length())
{
System.out.print(
"YES"
+
"\n"
);
}
else
{
System.out.print(
"NO"
+
"\n"
);
}
}
public
static
void
main(String[] args)
{
String str1 =
"abyzfe"
;
String str2 =
"abcdeyzf"
;
String str3 =
"popode"
;
convertString(str1, str2, str3);
}
}