from rdkit import Chem
import typing

def is_polymer(cur: str) -> bool:

    if cur.count('*') != 2:
        return False

    mol = Chem.MolFromSmiles(cur)
    if not mol:
        return False

    star_idxs: typing.List[int] = [atom.GetIdx() for atom in mol.GetAtoms() if atom.GetSymbol() == '*']

    bond_types_set: typing.Set[Chem.rdchem.BondType] = set()

    for star_idx in star_idxs:
        if len(mol.GetAtomWithIdx(star_idx).GetNeighbors()) != 1:
            return False
        bond_types_set = bond_types_set.union(
            {bond.GetBondType() for bond in mol.GetAtomWithIdx(star_idx).GetBonds()}
        )

    if len(bond_types_set) != 1:
        return False

    return True
