The regime of electromagnetically induced transparency in optically dense media: from atoms to excitons