Language: C++

#include<cstdio>
#include<cstring>
char a[1000000],b[1000000];
int c[26][2],k,l;
int main()
{
    gets(a);
    gets(b);
	l=strlen(a);
	for(int i=0;i<l;i++)
	{
		if(a[i]='a') c[1][1]++;
		else
		{
			if(a[i]='b') c[2][1]++;
			else
			{
				if(a[i]='c') c[3][1]++;
				else
				{
					if(a[i]='d') c[4][1]++;
					else
					{
						if(a[i]='e') c[5][1]++;
						else
						{
							if(a[i]='f') c[6][1]++;
							else
							{
								if(a[i]='g') c[7][1]++;
								else
								{
									if(a[i]='h') c[8][1]++;
									else
									{
										if(a[i]='i') c[9][1]++;
										else
										{
											if(a[i]='j') c[10][1]++;
											else
											{
												if(a[i]='k') c[11][1]++;
												else
												{
													if(a[i]='l') c[12][1]++;
													else
													{
														if(a[i]='m') c[13][1]++;
														else
														{
															if(a[i]='n') c[14][1]++;
															else
															{
																if(a[i]='o') c[15][1]++;
																else
																{
																	if(a[i]='p') c[16][1]++;
																	else
																	{
																		if(a[i]='q') c[17][1]++;
																		else
																		{
																			if(a[i]='r') c[18][1]++;
																			else
																			{
																				if(a[i]='s') c[19][1]++;
																				else
																				{
																					if(a[i]='t') c[20][1]++;
																					else
																					{
																						if(a[i]='u') c[21][1]++;
																						else
																						{
																							if(a[i]='v') c[22][1]++;
																							else
																							{
																								if(a[i]='w') c[23][1]++;
																								else
																								{
																									if(a[i]='x') c[24][1]++;
																									else
																									{
																										if(a[i]='y') c[25][1]++;
																										else
																										{
																											if(a[i]='z') c[26][1]++;
																										}
																									}
																								}
																							}
																						}
																					}
																				}
																			}
																		}
																	}
																}	
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
		if(b[i]='a') c[1][2]++;
		else
		{
			if(b[i]='b') c[2][2]++;
			else
			{
				if(b[i]='c') c[3][2]++;
				else
				{
					if(b[i]='d') c[4][2]++;
					else
					{
						if(b[i]='e') c[5][2]++;
						else
						{
							if(b[i]='f') c[6][2]++;
							else
							{
								if(b[i]='g') c[7][2]++;
								else
								{
									if(b[i]='h') c[8][2]++;
									else
									{
										if(b[i]='i') c[9][2]++;
										else
										{
											if(b[i]='j') c[10][2]++;
											else
											{
												if(b[i]='k') c[11][2]++;
												else
												{
													if(b[i]='l') c[12][2]++;
													else
													{
														if(b[i]='m') c[13][2]++;
														else
														{
															if(b[i]='n') c[14][2]++;
															else
															{
																if(b[i]='o') c[15][2]++;
																else
																{
																	if(b[i]='p') c[16][2]++;
																	else
																	{
																		if(b[i]='q') c[17][2]++;
																		else
																		{
																			if(b[i]='r') c[18][2]++;
																			else
																			{
																				if(b[i]='s') c[19][2]++;
																				else
																				{
																					if(b[i]='t') c[20][2]++;
																					else
																					{
																						if(b[i]='u') c[21][2]++;
																						else
																						{
																							if(b[i]='v') c[22][2]++;
																							else
																							{
																								if(b[i]='w') c[23][2]++;
																								else
																								{
																									if(b[i]='x') c[24][2]++;
																									else
																									{
																										if(b[i]='y') c[25][2]++;
																										else
																										{
																											if(b[i]='z') c[26][2]++;
																										}
																									}
																								}
																							}
																						}
																					}
																				}
																			}
																		}
																	}
																}	
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	for(int i=1;i<=26;i++)
	{
		if(c[i][1]!=c[i][2]) k++;
	}
	if(k>2)
	{
		printf("No");
		return 0;
	}
	printf("Yes");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    7 |     gets(a);
      |     ^~~~
      |     getw