using System;
using System.Collections.Generic;
public class Program
{
public static bool two_strings_have_same_words_in_different_order(string str1, string str2) {
if (str1.Length != str2.Length) {
return false;
}
string[] arr1 = str1.Split(' ');
List<string> wordsOfStr1 = new List<string>(arr1);
string[] wordsOfStr2 = str2.Split(' ');
for (int i = 0; i < wordsOfStr2.Length; i++) {
if (!wordsOfStr1.Contains(wordsOfStr2[i])) {
return false;
}
}
return true;
}
public static void Main(string[] args)
{
string str1 = "java c# c c++ python";
string str2 = "python c++ java c# c";
if (two_strings_have_same_words_in_different_order(str1, str2)) {
Console.WriteLine("yes");
}
else {
Console.WriteLine("no");
}
}
}
/*
run:
yes
*/