#import <stdio.h>
#define M 1000000007
typedef long long INT;

int main(){
    @autoreleasepool {
        INT N;
        scanf("%lld ", &N);
        INT a[26] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
        for(INT i=0;i<N;i++){
            char c;
            scanf("%c",&c);
            a[c-'a']++;
        }
        INT count = 1;
        for(int i=0;i<26;i++){
            count = ((a[i] % M) * count) % M;
        }
        printf("%lld", count-1);
    }
}

; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_343/source.m'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_343/source.m"
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"

$.objc_sel_namealloc = comdat any

$.objc_sel_namedrain = comdat any

$.objc_sel_nameinit = comdat any

@0 = private unnamed_addr constant [18 x i8] c"NSAutoreleasePool\00", align 1
@__objc_class_name_NSAutoreleasePool = external global i64
@__objc_class_ref_NSAutoreleasePool = weak local_unnamed_addr constant ptr @__objc_class_name_NSAutoreleasePool
@.str = private unnamed_addr constant [6 x i8] c"%lld \00", align 1
@__const.main.a = private unnamed_addr constant [26 x i64] [i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1], align 16
@.str.1 = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@1 = private unnamed_addr constant [12 x i8] c"AnotherHack\00", align 1
@2 = private unnamed_addr constant [33 x i8] c"__ObjC_Protocol_Holder_Ugly_Hack\00", align 1
@.objc_protocol_list = internal global { ptr, i64, [0 x ptr] } zeroinitializer, align 8
@3 = internal global { ptr, ptr, ptr, ptr, ptr } { ptr @1, ptr @2, ptr null, ptr null, ptr @.objc_protocol_list }, align 8
@.objc_sel_namealloc = linkonce_odr constant [6 x i8] c"alloc\00", comdat
@.objc_sel_namedrain = linkonce_odr constant [6 x i8] c"drain\00", comdat
@.objc_sel_nameinit = linkonce_odr constant [5 x i8] c"init\00", comdat
@.objc_selector_list = internal global [4 x { ptr, ptr }] [{ ptr, ptr } { ptr @.objc_sel_namealloc, ptr null }, { ptr, ptr } { ptr @.objc_sel_namedrain, ptr null }, { ptr, ptr } { ptr @.objc_sel_nameinit, ptr null }, { ptr, ptr } zeroinitializer], align 8
@4 = internal global { i64, ptr, i16, i16, [3 x ptr] } { i64 3, ptr @.objc_selector_list, i16 0, i16 1, [3 x ptr] [ptr @3, ptr null, ptr null] }, align 8
@.objc_source_file_name = private unnamed_addr constant [129 x i8] c"/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_343//data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_343/source.m\00", align 1
@5 = internal global { i64, i64, ptr, ptr } { i64 8, i64 32, ptr @.objc_source_file_name, ptr @4 }, align 8
@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @.objc_load_function, ptr null }]

; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
  %N = alloca i64, align 8
  %a = alloca [26 x i64], align 16
  %c = alloca i8, align 1
  %0 = tail call ptr (ptr, ...) @objc_lookup_class(ptr nonnull @0) #4
  %1 = tail call ptr @objc_msg_lookup(ptr %0, ptr nonnull @.objc_selector_list) #4, !GNUObjCMessageSend !5
  %call = tail call ptr %1(ptr noundef %0, ptr noundef nonnull @.objc_selector_list) #4, !GNUObjCMessageSend !5
  %2 = tail call ptr @objc_msg_lookup(ptr %call, ptr nonnull getelementptr inbounds ([4 x { ptr, ptr }], ptr @.objc_selector_list, i64 0, i64 2)) #4, !GNUObjCMessageSend !6
  %call1 = tail call ptr %2(ptr noundef %call, ptr noundef nonnull getelementptr inbounds ([4 x { ptr, ptr }], ptr @.objc_selector_list, i64 0, i64 2)) #4, !GNUObjCMessageSend !6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #4
  %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
  call void @llvm.lifetime.start.p0(i64 208, ptr nonnull %a) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(208) %a, ptr noundef nonnull align 16 dereferenceable(208) @__const.main.a, i64 208, i1 false)
  %3 = load i64, ptr %N, align 8, !tbaa !7
  %cmp23 = icmp sgt i64 %3, 0
  br i1 %cmp23, label %for.body, label %for.cond6.preheader

for.cond6.preheader.loopexit:                     ; preds = %for.body
  %.pre = load i64, ptr %a, align 16, !tbaa !7
  %arrayidx12.1.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 1
  %.pre28 = load i64, ptr %arrayidx12.1.phi.trans.insert, align 8, !tbaa !7
  %arrayidx12.2.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 2
  %.pre29 = load i64, ptr %arrayidx12.2.phi.trans.insert, align 16, !tbaa !7
  %arrayidx12.3.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 3
  %.pre30 = load i64, ptr %arrayidx12.3.phi.trans.insert, align 8, !tbaa !7
  %arrayidx12.4.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 4
  %.pre31 = load i64, ptr %arrayidx12.4.phi.trans.insert, align 16, !tbaa !7
  %arrayidx12.5.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 5
  %.pre32 = load i64, ptr %arrayidx12.5.phi.trans.insert, align 8, !tbaa !7
  %arrayidx12.6.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 6
  %.pre33 = load i64, ptr %arrayidx12.6.phi.trans.insert, align 16, !tbaa !7
  %arrayidx12.7.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 7
  %.pre34 = load i64, ptr %arrayidx12.7.phi.trans.insert, align 8, !tbaa !7
  %arrayidx12.8.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 8
  %.pre35 = load i64, ptr %arrayidx12.8.phi.trans.insert, align 16, !tbaa !7
  %arrayidx12.9.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 9
  %.pre36 = load i64, ptr %arrayidx12.9.phi.trans.insert, align 8, !tbaa !7
  %arrayidx12.10.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 10
  %.pre37 = load i64, ptr %arrayidx12.10.phi.trans.insert, align 16, !tbaa !7
  %arrayidx12.11.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 11
  %.pre38 = load i64, ptr %arrayidx12.11.phi.trans.insert, align 8, !tbaa !7
  %arrayidx12.12.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 12
  %.pre39 = load i64, ptr %arrayidx12.12.phi.trans.insert, align 16, !tbaa !7
  %arrayidx12.13.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 13
  %.pre40 = load i64, ptr %arrayidx12.13.phi.trans.insert, align 8, !tbaa !7
  %arrayidx12.14.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 14
  %.pre41 = load i64, ptr %arrayidx12.14.phi.trans.insert, align 16, !tbaa !7
  %arrayidx12.15.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 15
  %.pre42 = load i64, ptr %arrayidx12.15.phi.trans.insert, align 8, !tbaa !7
  %arrayidx12.16.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 16
  %.pre43 = load i64, ptr %arrayidx12.16.phi.trans.insert, align 16, !tbaa !7
  %arrayidx12.17.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 17
  %.pre44 = load i64, ptr %arrayidx12.17.phi.trans.insert, align 8, !tbaa !7
  %arrayidx12.18.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 18
  %.pre45 = load i64, ptr %arrayidx12.18.phi.trans.insert, align 16, !tbaa !7
  %arrayidx12.19.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 19
  %.pre46 = load i64, ptr %arrayidx12.19.phi.trans.insert, align 8, !tbaa !7
  %arrayidx12.20.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 20
  %.pre47 = load i64, ptr %arrayidx12.20.phi.trans.insert, align 16, !tbaa !7
  %4 = srem i64 %.pre, 1000000007
  %5 = srem i64 %.pre28, 1000000007
  %6 = mul nsw i64 %5, %4
  %7 = srem i64 %6, 1000000007
  %8 = srem i64 %.pre29, 1000000007
  %9 = mul nsw i64 %8, %7
  %10 = srem i64 %9, 1000000007
  %11 = srem i64 %.pre30, 1000000007
  %12 = mul nsw i64 %11, %10
  %13 = srem i64 %12, 1000000007
  %14 = srem i64 %.pre31, 1000000007
  %15 = mul nsw i64 %14, %13
  %16 = srem i64 %15, 1000000007
  %17 = srem i64 %.pre32, 1000000007
  %18 = mul nsw i64 %17, %16
  %19 = srem i64 %18, 1000000007
  %20 = srem i64 %.pre33, 1000000007
  %21 = mul nsw i64 %20, %19
  %22 = srem i64 %21, 1000000007
  %23 = srem i64 %.pre34, 1000000007
  %24 = mul nsw i64 %23, %22
  %25 = srem i64 %24, 1000000007
  %26 = srem i64 %.pre35, 1000000007
  %27 = mul nsw i64 %26, %25
  %28 = srem i64 %27, 1000000007
  %29 = srem i64 %.pre36, 1000000007
  %30 = mul nsw i64 %29, %28
  %31 = srem i64 %30, 1000000007
  %32 = srem i64 %.pre37, 1000000007
  %33 = mul nsw i64 %32, %31
  %34 = srem i64 %33, 1000000007
  %35 = srem i64 %.pre38, 1000000007
  %36 = mul nsw i64 %35, %34
  %37 = srem i64 %36, 1000000007
  %38 = srem i64 %.pre39, 1000000007
  %39 = mul nsw i64 %38, %37
  %40 = srem i64 %39, 1000000007
  %41 = srem i64 %.pre40, 1000000007
  %42 = mul nsw i64 %41, %40
  %43 = srem i64 %42, 1000000007
  %44 = srem i64 %.pre41, 1000000007
  %45 = mul nsw i64 %44, %43
  %46 = srem i64 %45, 1000000007
  %47 = srem i64 %.pre42, 1000000007
  %48 = mul nsw i64 %47, %46
  %49 = srem i64 %48, 1000000007
  %50 = srem i64 %.pre43, 1000000007
  %51 = mul nsw i64 %50, %49
  %52 = srem i64 %51, 1000000007
  %53 = srem i64 %.pre44, 1000000007
  %54 = mul nsw i64 %53, %52
  %55 = srem i64 %54, 1000000007
  %56 = srem i64 %.pre45, 1000000007
  %57 = mul nsw i64 %56, %55
  %58 = srem i64 %57, 1000000007
  %59 = srem i64 %.pre46, 1000000007
  %60 = mul nsw i64 %59, %58
  %61 = srem i64 %60, 1000000007
  %62 = srem i64 %.pre47, 1000000007
  %63 = mul nsw i64 %62, %61
  %64 = srem i64 %63, 1000000007
  br label %for.cond6.preheader

for.cond6.preheader:                              ; preds = %for.cond6.preheader.loopexit, %entry
  %mul.20 = phi i64 [ %64, %for.cond6.preheader.loopexit ], [ 1, %entry ]
  %arrayidx12.21 = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 21
  %65 = load i64, ptr %arrayidx12.21, align 8, !tbaa !7
  %rem.21 = srem i64 %65, 1000000007
  %mul.21 = mul nsw i64 %rem.21, %mul.20
  %rem13.21 = srem i64 %mul.21, 1000000007
  %arrayidx12.22 = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 22
  %66 = load i64, ptr %arrayidx12.22, align 16, !tbaa !7
  %rem.22 = srem i64 %66, 1000000007
  %mul.22 = mul nsw i64 %rem.22, %rem13.21
  %rem13.22 = srem i64 %mul.22, 1000000007
  %arrayidx12.23 = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 23
  %67 = load i64, ptr %arrayidx12.23, align 8, !tbaa !7
  %rem.23 = srem i64 %67, 1000000007
  %mul.23 = mul nsw i64 %rem.23, %rem13.22
  %rem13.23 = srem i64 %mul.23, 1000000007
  %arrayidx12.24 = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 24
  %68 = load i64, ptr %arrayidx12.24, align 16, !tbaa !7
  %rem.24 = srem i64 %68, 1000000007
  %mul.24 = mul nsw i64 %rem.24, %rem13.23
  %rem13.24 = srem i64 %mul.24, 1000000007
  %arrayidx12.25 = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 25
  %69 = load i64, ptr %arrayidx12.25, align 8, !tbaa !7
  %rem.25 = srem i64 %69, 1000000007
  %mul.25 = mul nsw i64 %rem.25, %rem13.24
  %rem13.25 = srem i64 %mul.25, 1000000007
  %sub17 = add nsw i64 %rem13.25, -1
  %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %sub17)
  call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %a) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #4
  %70 = call ptr @objc_msg_lookup(ptr %call1, ptr nonnull getelementptr inbounds ([4 x { ptr, ptr }], ptr @.objc_selector_list, i64 0, i64 1)) #4, !GNUObjCMessageSend !11
  call void %70(ptr noundef %call1, ptr noundef nonnull getelementptr inbounds ([4 x { ptr, ptr }], ptr @.objc_selector_list, i64 0, i64 1)) #4, !GNUObjCMessageSend !11
  ret i32 0

for.body:                                         ; preds = %entry, %for.body
  %i.024 = phi i64 [ %inc4, %for.body ], [ 0, %entry ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #4
  %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c)
  %71 = load i8, ptr %c, align 1, !tbaa !12
  %conv = sext i8 %71 to i64
  %sub = add nsw i64 %conv, -97
  %arrayidx = getelementptr inbounds [26 x i64], ptr %a, i64 0, i64 %sub
  %72 = load i64, ptr %arrayidx, align 8, !tbaa !7
  %inc = add nsw i64 %72, 1
  store i64 %inc, ptr %arrayidx, align 8, !tbaa !7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #4
  %inc4 = add nuw nsw i64 %i.024, 1
  %73 = load i64, ptr %N, align 8, !tbaa !7
  %cmp = icmp slt i64 %inc4, %73
  br i1 %cmp, label %for.body, label %for.cond6.preheader.loopexit
}

declare ptr @objc_lookup_class(ptr, ...) local_unnamed_addr

declare ptr @objc_msg_lookup(ptr, ptr) local_unnamed_addr

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

define internal void @.objc_load_function() {
entry:
  tail call void (ptr, ...) @__objc_exec_class(ptr nonnull @5)
  ret void
}

declare void @__objc_exec_class(ptr, ...) local_unnamed_addr

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind }

!llvm.linker.options = !{}
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!"alloc", !"", i1 false}
!6 = !{!"init", !"", i1 false}
!7 = !{!8, !8, i64 0}
!8 = !{!"long long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"drain", !"", i1 false}
!12 = !{!9, !9, i64 0}
