output_description: Print the number of possible arrangements, modulo 10^9+7.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N M
attempt: MOD = 10**9 + 7
  
  
  class Fp(int):
      def __new__(self, x=0):
          return super().__new__(self, x % MOD)
  
      def inv(self):
          return self.__class__(super().__pow__(MOD - 2, MOD))
  
      def __add__(self, value):
          return self.__class__(super().__add__(value))
  
      def __sub__(self, value):
          return self.__class__(super().__sub__(value))
  
      def __mul__(self, value):
          return self.__class__(super().__mul__(value))
  
      def __floordiv__(self, value):
          return self.__class__(self * self.__class__(value).inv())
  
      def __pow__(self, value):
          return self.__class__(super().__pow__(value % (MOD - 1), MOD))
  
      __radd__ = __add__
      __rmul__ = __mul__
  
      def __rsub__(self, value):
          return self.__class__(-super().__sub__(value))
  
      def __rfloordiv__(self, value):
          return self.__class__(self.inv() * value)
  
      def __iadd__(self, value):
          self = self + value
          return self
  
      def __isub__(self, value):
          self = self - value
          return self
  
      def __imul__(self, value):
          self = self * value
          return self
  
      def __ifloordiv__(self, value):
          self = self // value
          return self
  
      def __ipow__(self, value):
          self = self**value
          return self
  
      def __neg__(self):
          return self.__class__(super().__neg__())
  
  
  class Combination:
      def __init__(self, max_n):
          self.max_n = 0
          self.fact = [Fp(1)]
          self.ifact = [Fp(1)]
          self.make_fact_list(max_n)
  
      def C(self, n, k):
          return self.fact[n] * self.ifact[k] * self.ifact[n - k] if 0 <= k <= n else 0
  
      def H(self, n, k):
          return self.C(n + k - 1, k) if n or k else 1
  
      def P(self, n, k):
          return self.fact[n] * self.ifact[n - k] if 0 <= k <= n else 0
  
      def make_fact_list(self, max_n):
          if max_n <= self.max_n:
              return
          self.fact += [Fp(0)] * (max_n - self.max_n)
          self.ifact += [Fp(0)] * (max_n - self.max_n)
          for i in range(self.max_n + 1, max_n + 1):
              self.fact[i] = self.fact[i - 1] * i
              self.ifact[i] = self.ifact[i - 1] // i
          self.max_n = max_n
  
  
  N, M = sorted(map(int, input().split()))
  p = Combination(M)
  ans = p.fact[N] * p.fact[M]
  if N == M:
      ans *= 2
  if abs(N - M) > 1:
      ans = 0
  print(ans)
  
problem_description: Statement
  
  Snuke has N dogs and M monkeys. He wants them to line up in a row.
  
  As a Japanese saying goes, these dogs and monkeys are on bad terms. _("ken'en
  no naka", literally "the relationship of dogs and monkeys", means a
  relationship of mutual hatred.)_ Snuke is trying to reconsile them, by
  arranging the animals so that there are neither two adjacent dogs nor two
  adjacent monkeys.
  
  How many such arrangements there are? Find the count modulo 10^9+7 (since
  animals cannot understand numbers larger than that). Here, dogs and monkeys
  are both distinguishable. Also, two arrangements that result from reversing
  each other are distinguished.
samples: [{"input": "2 2", "output": "8\n    \n\nWe will denote the dogs by `A` and `B`, and the monkeys by `C` and `D`. There\nare eight possible arrangements: `ACBD`, `ADBC`, `BCAD`, `BDAC`, `CADB`,\n`CBDA`, `DACB` and `DBCA`.\n\n* * *"}, {"input": "3 2", "output": "12\n    \n\n* * *"}, {"input": "1 8", "output": "0\n    \n\n* * *"}, {"input": "100000 100000", "output": "530123477"}]