<?php

error_reporting(-1);

$text = "А роза упала на лапу Азора";

$text = mb_strtolower($text);
$text = str_replace(" ","",$text);

$length = mb_strlen($text);
$halfLength = floor($length/2);
$a = -1;
for ($i = 0; $i <= halfLength; $i++) {
		if (mb_substr($text,$i,1) == mb_substr($text,$a,1)) {
			$result = "YES";
		} 
		else if (mb_substr($text,$i,1) != mb_substr($text,$a,1)) {
			$result = "NO";
			break;	
		}
		$a=$a-1;		
}
echo $result;
