The task is to choose nonadjacent entries from a circular list and maximize their sum. Adjacent means neighboring positions, including the first and last positions. Choosing nothing is allowed, so an empty input or a list of negative values should return zero. I will treat a one-element list as having one available choice rather than as a position adjacent to itself. That convention gives max(0, value) for a singleton, which is the usual interpretation of this selection problem.

On a linear list, the dynamic program is simple. After processing a prefix, keep the best total for that prefix and the best total for the prefix ending one position earlier. When the next value arrives, either omit it and preserve the current best, or include it and add it to the best value from two positions earlier. Taking the maximum of those alternatives gives the new best. This uses constant storage because the transition depends only on the previous two prefix results, not on the complete history of choices.

Initially, I could try applying that same recurrence around the circle and then checking whether both endpoints were selected. But wait, a recurrence that stores only the best total does not retain enough information to repair that conflict afterward. If its best linear solution uses both endpoints, removing the smaller endpoint is not guaranteed to find the best circular solution. Another solution with different interior choices might beat the repaired one. The endpoint restriction needs to be included before the linear optimization, rather than patched into an already-compressed result.

There is a useful two-case decomposition. Every valid circular selection excludes at least one of the first and last positions, because those positions are adjacent. Consider all selections that exclude the last position: they are exactly the nonadjacent selections on values[0:n-1]. Next consider all selections that exclude the first position: they are exactly the nonadjacent selections on values[1:n]. Every valid circular solution belongs to at least one of these families. Some selections exclude both endpoints and occur in both families, but duplication does not matter when we take a maximum instead of counting solutions.

Thus the circular optimum is the larger of the two linear optima. This is not an approximation or a greedy split. One inequality follows because every solution in either linear family is also valid in the circle after its excluded endpoint is omitted. The other inequality follows because every circular solution appears in one of the families. The maximum over their union must therefore equal the circular optimum. The argument remains valid with negative values because it concerns membership of feasible selections, not any positivity assumption.

For an example, use [6, 2, 7, 5]. On the first three positions, the linear optimum is 6 + 7 = 13. On the last three positions, the optimum is 2 + 5 = 7. The circular result is 13, and the first and last entries are never both selected. For [4, 9, 4], the two ranges both produce 9. A linear pass over the entire input would also happen to produce 9 here, but that agreement is incidental. On [8, 1, 1, 8], the full linear result would be 16 using both endpoints, which the circular problem forbids. The two-range method instead returns 9.

Actually, the smallest inputs deserve separate attention before slicing the ranges. A singleton would create two empty ranges if we blindly removed either endpoint, producing zero even when its value is positive. That is why the singleton case must be handled explicitly. For two entries, the two linear ranges each contain one position, so their maximum chooses the better entry or nothing. This matches the fact that both positions are neighbors and cannot be chosen together. Empty input has no endpoints and should return zero before any indexing occurs.

For the linear helper, name the two state values previous and current. Before reading a value at index i, current is the best total for all entries before i, and previous is the best total for all entries before i - 1. Including the new entry gives previous + values[i], while excluding it gives current. The assignment previous, current = current, max(current, previous + values[i]) updates both states simultaneously using their old values. Sequentially assigning previous first without preserving its old value would accidentally permit adjacent selections, so tuple assignment is a useful way to express the transition safely.

Both states start at zero. This includes the empty selection automatically and prevents a negative value from forcing the answer below zero. For a prefix containing [-3, -2], current remains zero throughout. For [-3, 5, -2], the positive middle entry raises it to five, and the negative trailing entry is skipped. There is no need to filter negative values before running the recurrence. Such filtering would change adjacency relationships by moving originally separated positions together or erasing the gap that prevents two selections from being adjacent.

The helper should accept start and stop indices rather than copying list slices. Slices would be perfectly correct, but they allocate additional lists proportional to the input size. Iterating over range(start, stop) keeps the extra storage constant and works directly on the caller's collection. The helper reads each value and never writes into the list, so preserving the input requires no further copying. The outer function performs two linear scans, which is still O(n) time because the constant factor of two does not change the asymptotic bound.

Let me also verify the role of equal totals. The recurrence only returns a numeric maximum, so it does not matter whether two distinct selections achieve the same sum. There is no tie-breaking requirement about which positions to return. If we later needed the chosen indices, we would have to preserve decisions or reconstruct them from a table, and the two circular cases would need an explicit tie policy. None of that information is necessary for the requested total. Keeping it out makes the code reflect the current interface instead of anticipating a larger problem.

A useful way to view correctness is to combine two independent proofs. The linear recurrence is correct by induction on the number of available positions: every selection either omits the last entry or includes it and therefore omits its immediate predecessor. The circular reduction is correct because excluding either endpoint covers every feasible circular selection. Since each helper call solves its linear family exactly and the outer maximum covers their union, the composition solves the original circular problem. Each part has a small state space and a direct reason that no other case exists.

This gives a complete implementation without backtracking or special treatment of signs beyond allowing the empty choice. The explicit empty and singleton cases resolve the only sizes where the endpoint decomposition needs care. The final function is:

```python
def maximum_circular_nonadjacent_sum(values):
    count = len(values)
    if count == 0:
        return 0
    if count == 1:
        return max(0, values[0])

    def linear_best(start, stop):
        previous = 0
        current = 0
        for index in range(start, stop):
            previous, current = current, max(current, previous + values[index])
        return current

    return max(linear_best(0, count - 1), linear_best(1, count))
```
