#include<stdio.h>
int main()
{
int i,a,n,count=0;
scanf("%d",&n);
char s[n],t[n+1];
scanf("%s %s",&s,&t); 
for(i=0;i<n;i++)
  {
   if(s[i]==t[i])
   count=count+1;
  }
if(count==n)
printf("Yes\n");
else
printf("No\n");
return 0;
}