#include <iostream>
using std::cout, std::endl, std::string;
#include <algorithm>
using std::is_permutation;
bool isAnagram(const string& firstWord, const string& secondWord){
if(firstWord.length()!=secondWord.length()){
return false;
}
return is_permutation(firstWord.begin(), firstWord.end(), secondWord.begin());
}
int main()
{
isAnagram("apprp","adppp") ? cout<<"is Anagram"<<endl: cout<<"NOT Anagram"<<endl;
return 0;
}