q; Alice and Strings | Practice Problems

```
#include<bits/stdc++.h>
using namespace std;
int main()
{
int k,i,j,t=0;
string s1;
string s2;
cin>>s1;
cin>>s2;
int l=0;
l = s1.length();
i=l;
while(i>0)
{
if(s1[i]==s2[i])
{
i--;
}
else
{
for(j=0;j<i;j++)
{
s1[j] = s1[j]+1;
}
i=i;
}
}
for(k=0;k<l;k++)
{
if(s1[k]==s2[k])
{
t++;
}
}
if(t==l)
{
cout<<"YES";
}
else
{
cout<<"NO";
}
return 0;
}
```