'Return head and tail of self.
This is the most efficient way to get the head and tail of an
expression.
- if you want only the head, use self.args[0];
- if you want to process the arguments of the tail then use
self.as_coef_mul() which gives the head and a tuple containing
the arguments of the tail when treated as a Mul.
- if you want the coefficient when self is treated as an Add
then use self.as_coeff_add()[0]
>>> from sympy.abc import x, y
>>> (3*x*y).as_two_terms()
(3, x*y)'

@cacheit
def as_two_terms(self):

    args = self.args
    if (len(args) == 1):
        return (S.One, self)
    elif (len(args) == 2):
        return args
    else:
        return (args[0], self._new_rawargs(*args[1:]))
