public static void main ( String [ ] $ ) {
  int n = s . nextInt ( ) - 1 , m = s . nextInt ( ) - 1 ;
  long [ ] a = new long [ n ] , b = new long [ m ] ;
  f ( a ) ;
  f ( b ) ;
  System . err . println ( Arrays . toString ( a ) ) ;
  System . err . println ( Arrays . toString ( b ) ) ;
  long A = g ( n , a ) , B = g ( m , b ) ;
  System . out . println ( A * B % mod ) ;
}

public static void main ( String [ ] $ ) { int n = s . nextInt ( ) - 1 , m = s . nextInt ( ) - 1 ; long [ ] a = new long [ n ] , b = new long [ m ] ; f ( a ) ; f ( b ) ; System . err . println ( Arrays . toString ( a ) ) ; System . err . println ( Arrays . toString ( b ) ) ; long A = g ( n , a ) , B = g ( m , b ) ; System . out . println ( A * B % mod ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal))) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier)))) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier)))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier)))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier)))) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)))))))