static void solve ( ) {
  int n = ni ( ) ;
  p = new int [ n ] ;
  int a [ ] = ai ( n ) ;
  int f [ ] = ai ( n ) ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) p [ i ] = i ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    if ( ( i + f [ i ] ) < n ) union ( i , i + f [ i ] ) ;
    if ( ( i - f [ i ] ) >= 0 ) union ( i , i - f [ i ] ) ;
  }
  String f1 = "YES" ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) if ( find ( i ) != find ( a [ i ] - 1 ) ) {
    f1 = "NO" ;
    break ;
  }
  pn ( f1 ) ;
  out . flush ( ) ;
}

static void solve ( ) { int n = ni ( ) ; p = new int [ n ] ; int a [ ] = ai ( n ) ; int f [ ] = ai ( n ) ; for ( int i = 0 ; i < n ; i ++ ) p [ i ] = i ; for ( int i = 0 ; i < n ; i ++ ) { if ( ( i + f [ i ] ) < n ) union ( i , i + f [ i ] ) ; if ( ( i - f [ i ] ) >= 0 ) union ( i , i - f [ i ] ) ; } String f1 = " YES " ; for ( int i = 0 ; i < n ; i ++ ) if ( find ( i ) != find ( a [ i ] - 1 ) ) { f1 = " NO " ; break ; } pn ( f1 ) ; out . flush ( ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (method_invocation name: (identifier) arguments: (argument_list (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (method_invocation name: (identifier) arguments: (argument_list (identifier))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))) right: (identifier))) consequence: (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))) right: (decimal_integer_literal))) consequence: (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (string_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (identifier))) right: (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (string_literal))) (break_statement)))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))