program prob4
    implicit none
    integer::N, i, ans, l, j, k
    character(len=200005)::S,T
    integer::c(26), d(26)
    read(*,*) S, T
    l = len_trim(S)
    c = 0
    d = 0

    do i = 1, l
        j = ichar(S(i:i)) - 96
        k = ichar(T(i:i)) - 96
        if(c(j) > 0) then
            if(k .ne. c(j)) then
                write(*,'(a)') "No"
                stop
            end if
        else
            c(j) = k
        end if
        if(d(k) > 0) then
            if(j .ne. d(k)) then
                write(*,'(a)') "No"
                stop
            end if
        else
            d(k) = j
        end if
    end do
    write(*,'(a)') "Yes"
    stop
end program
; ModuleID = 'FIRModule'
source_filename = "FIRModule"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@_QFEc = internal unnamed_addr global [26 x i32] undef
@_QFEd = internal unnamed_addr global [26 x i32] undef
@_QFEs = internal global [200005 x i8] undef
@_QFEt = internal global [200005 x i8] undef
@_QQcl.aa870b0585143e644515b90702918f26 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_5510/source.f\00"
@_QQcl.286129 = linkonce constant [3 x i8] c"(a)"
@_QQcl.4E6F = linkonce constant [2 x i8] c"No"
@_QQcl.596573 = linkonce constant [3 x i8] c"Yes"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #0 {
  %1 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.aa870b0585143e644515b90702918f26, i32 6)
  %2 = tail call i1 @_FortranAioInputAscii(ptr %1, ptr nonnull @_QFEs, i64 200005)
  %3 = tail call i1 @_FortranAioInputAscii(ptr %1, ptr nonnull @_QFEt, i64 200005)
  %4 = tail call i32 @_FortranAioEndIoStatement(ptr %1)
  br label %5

5:                                                ; preds = %0, %5
  %6 = phi i64 [ 200004, %0 ], [ %10, %5 ]
  %7 = getelementptr [200005 x [1 x i8]], ptr @_QFEs, i64 0, i64 %6
  %8 = load i8, ptr %7, align 1, !tbaa !3
  %9 = icmp eq i8 %8, 32
  %10 = add nsw i64 %6, -1
  %11 = icmp ne i64 %6, 0
  %12 = and i1 %9, %11
  br i1 %12, label %5, label %.preheader24.preheader

.preheader24.preheader:                           ; preds = %5
  %13 = trunc i64 %6 to i32
  %14 = add i32 %13, 1
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) @_QFEc, i8 0, i64 104, i1 false), !tbaa !3
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) @_QFEd, i8 0, i64 104, i1 false), !tbaa !3
  %15 = select i1 %9, i32 0, i32 %14
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader24.preheader
  %17 = add nuw i32 %15, 1
  %wide.trip.count = zext i32 %17 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %50
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %50 ]
  %18 = add nsw i64 %indvars.iv, -1
  %19 = getelementptr [200005 x [1 x i8]], ptr @_QFEs, i64 0, i64 %18
  %.unpack = load i8, ptr %19, align 1, !tbaa !3
  %20 = zext i8 %.unpack to i32
  %21 = add nsw i32 %20, -96
  %22 = getelementptr [200005 x [1 x i8]], ptr @_QFEt, i64 0, i64 %18
  %.unpack22 = load i8, ptr %22, align 1, !tbaa !3
  %23 = zext i8 %.unpack22 to i32
  %24 = add nsw i32 %23, -96
  %25 = zext i8 %.unpack to i64
  %26 = add nsw i64 %25, -97
  %27 = getelementptr [26 x i32], ptr @_QFEc, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !3
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %30, label %36

30:                                               ; preds = %.lr.ph
  %.not23 = icmp eq i32 %24, %28
  br i1 %.not23, label %37, label %31

31:                                               ; preds = %30
  %32 = tail call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.aa870b0585143e644515b90702918f26, i32 16)
  %33 = tail call i1 @_FortranAioOutputAscii(ptr %32, ptr nonnull @_QQcl.4E6F, i64 2)
  %34 = tail call i32 @_FortranAioEndIoStatement(ptr %32)
  %35 = tail call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

36:                                               ; preds = %.lr.ph
  store i32 %24, ptr %27, align 4, !tbaa !3
  br label %37

37:                                               ; preds = %30, %36
  %38 = zext i8 %.unpack22 to i64
  %39 = add nsw i64 %38, -97
  %40 = getelementptr [26 x i32], ptr @_QFEd, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !3
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %43, label %49

43:                                               ; preds = %37
  %.not = icmp eq i32 %21, %41
  br i1 %.not, label %50, label %44

44:                                               ; preds = %43
  %45 = tail call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.aa870b0585143e644515b90702918f26, i32 24)
  %46 = tail call i1 @_FortranAioOutputAscii(ptr %45, ptr nonnull @_QQcl.4E6F, i64 2)
  %47 = tail call i32 @_FortranAioEndIoStatement(ptr %45)
  %48 = tail call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

49:                                               ; preds = %37
  store i32 %21, ptr %40, align 4, !tbaa !3
  br label %50

50:                                               ; preds = %43, %49
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %50, %.preheader24.preheader
  %51 = tail call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.aa870b0585143e644515b90702918f26, i32 31)
  %52 = tail call i1 @_FortranAioOutputAscii(ptr %51, ptr nonnull @_QQcl.596573, i64 3)
  %53 = tail call i32 @_FortranAioEndIoStatement(ptr %51)
  %54 = tail call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

declare ptr @_FortranAioBeginExternalListInput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputAscii(ptr, ptr, i64) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputAscii(ptr, ptr, i64) local_unnamed_addr

declare {} @_FortranAStopStatement(i32, i1, i1) local_unnamed_addr

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

attributes #0 = { noreturn }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!llvm.module.flags = !{!0, !1, !2}

!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{!4, !4, i64 0}
!4 = !{!"any data access", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
