output_description: Print the number of the subsequences such that all characters are different,
  modulo 10^9+7.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      S
attempt: import sys
  
  sys.setrecursionlimit(1000000)
  # def input():
  #    return sys.stdin.readline()[:-1]
  
  """
  n=int(input())
  for i in range(n):
      a[i]=int(input())
      a[i],b[i]=map(int,input().split())
  a=[int(x) for x in input().split()]
  n,m=map(int,input.split())
  from operator import itemgetter
  a = [(1, "c", 1), (1, "b", 3), (2, "a", 0), (1, "a", 2)]
  print(sorted(a))  # 0 番目の要素でソート、先頭の要素が同じなら 1 番目以降の要素も見る
  print(sorted(a, key=itemgetter(0)))  # 0 番目の要素だけでソート
  print(sorted(a, key=itemgetter(0, 2)))  # 0 番目と 2 番目の要素でソート
  print(sorted(a, key=lambda x: x[0] * x[2]))  # 0 番目の要素 * 2 番目の要素でソート
  print(sorted(a, reverse=True))  # 降順にソート
  a.sort()  # 破壊的にソート、sorted() よりも高速
  try: # エラーキャッチ list index out of range
      for i in range():
          k=b[i]
  except IndexError as e:
      print(i)
  """
  
  test_data1 = """\
  4
  abcd
  """
  
  test_data2 = """\
  3
  baa
  """
  
  test_data3 = """\
  5
  abcab
  """
  td_num = 2
  
  
  def GetTestData(index):
      if index == 1:
          return test_data1
      if index == 2:
          return test_data2
      if index == 3:
          return test_data3
  
  
  if False:
      with open("../test.txt", mode="w") as f:
          f.write(GetTestData(td_num))
      with open("../test.txt") as f:
          # Start Input code ---------------------------------------
          # n,m,c=map(int,f.readline().split())
          n = int(f.readline())
          s = str(f.readline())
          # End Input code ---------------------------------------
  else:
      # Start Input code ---------------------------------------
      n = int(input())
      s = str(input())
      # End Input code ---------------------------------------
  # print(n,s)
  import string
  
  al = string.ascii_lowercase
  cnt = []
  for i in range(26):
      alc = s.count(al[i])
      if alc != 0:
          cnt.append(alc)
  
  # print(cnt)
  m = len(cnt)
  ans = 1
  mo = 10**9 + 7
  counter = 0
  for i in range(m):
      ans *= (1 + cnt[i]) % mo
  ans -= 1
  """
  for i in range(1,2**m):
      counter+=1
      pat=1
      for j in range (m):
          #print(int((i % 2**(j+1)) / 2**j))
          ind=int((i % 2**(j+1)) / 2**j)
          pat*=max(1,cnt[j]*ind) % mo
          #print('ind,cnt[ind]=',ind,cnt[ind])
      ans+=pat
      #print(pat,ans)
      #print(bin(i))
  """
  print(ans)
  
problem_description: Statement
  
  You are given a string S of length N. Among its subsequences, count the ones
  such that all characters are different, modulo 10^9+7. Two subsequences are
  considered different if their characters come from different positions in the
  string, even if they are the same as strings.
  
  Here, a subsequence of a string is a concatenation of **one or more**
  characters from the string without changing the order.
samples: [{"input": "4\n    abcd", "output": "15\n    \n\nSince all characters in S itself are different, all its subsequences satisfy\nthe condition.\n\n* * *"}, {"input": "3\n    baa", "output": "5\n    \n\nThe answer is five: `b`, two occurrences of `a`, two occurrences of `ba`. Note\nthat we do not count `baa`, since it contains two `a`s.\n\n* * *"}, {"input": "5\n    abcab", "output": "17"}]