A geometric mechanism of vacuum energy cancellation