A polymer comprising: a first unit represented by the following Chemical Formula 1; and a second unit represented by the following Chemical Formula 2: in Chemical Formulae 1 and 2, d1, d2, x, and x' are each 1 or 2, when d1, d2, x, and x' are each 2, structures in the parenthesis are the same as or different from each other, X1 and X2 are the same as or different from each other, and are each independently CRR', NR, O, SiRR', PR, S, GeRR', Se or Te, Y1 to Y4 are the same as or different from each other, and are each independently CR", N, SiR", P, or GeR", X and X' are the same as or different from each other, and are each independently S or Se, Ar1 and Ar2 are the same as or different from each other, and are each independently a substituted or unsubstituted straight or branched alkyl group, R1 and R2 are the same as or different from each other, and are each independently a substituted or unsubstituted branched alkyl group, G1 and G2 are the same as or different from each other, and are each independently hydrogen; or fluorine, R, R', and R" are the same as or different from each other, and are each independently hydrogen; deuterium; a halogen group; a hydroxy group; a substituted or unsubstituted alkyl group; a substituted or unsubstituted alkoxy group; a substituted or unsubstituted aryl group; or a substituted or unsubstituted heterocyclic group, and D1 and D2 are the same as or different from each other, and are each independently any one selected from the following structures, provided that at least one of D1 and D2 is in the structures, X", X"', and X"" are the same as or different from each other, and are each independently S or Se, Y and Y' are the same as or different from each other, and are each independently CR"', N, SiR"', P, or GeR"', two of G11 to G14 are fluorine, and the others are hydrogen, G15 to G18, G101, and G102 are the same as or different from each other, and are each independently hydrogen; or fluorine, R"' is hydrogen; deuterium; a halogen group; a hydroxy group; a substituted or unsubstituted alkyl group; a substituted or unsubstituted alkoxy group; a substituted or unsubstituted aryl group; or a substituted or unsubstituted heterocyclic group, g is 0 or 1, and when a group is "substituted", it is substituted with one or more substituents selected from the group consisting of deuterium; a halogen group; a nitrile group; a nitro group; an imide group; an amide group; a hydroxy group; an alkyl group; a cycloalkyl group; an alkoxy group; an aryloxy group; an alkylthioxy group; an arylthioxy group; an alkylsulfoxy group; an arylsulfoxy group; an alkenyl group; n aryl group; and a heterocyclic group, or is substituted with a substituent to which two or more substituents are linked among the substituents listed above. a first unit represented by the following Chemical Formula 1; and a second unit represented by the following Chemical Formula 2: in Chemical Formulae 1 and 2, d1, d2, x, and x' are each 1 or 2, when d1, d2, x, and x' are each 2, structures in the parenthesis are the same as or different from each other, X1 and X2 are the same as or different from each other, and are each independently CRR', NR, O, SiRR', PR, S, GeRR', Se or Te, Y1 to Y4 are the same as or different from each other, and are each independently CR", N, SiR", P, or GeR", X and X' are the same as or different from each other, and are each independently S or Se, Ar1 and Ar2 are the same as or different from each other, and are each independently a substituted or unsubstituted straight or branched alkyl group, R1 and R2 are the same as or different from each other, and are each independently a substituted or unsubstituted branched alkyl group, G1 and G2 are the same as or different from each other, and are each independently hydrogen; or fluorine, R, R', and R" are the same as or different from each other, and are each independently hydrogen; deuterium; a halogen group; a hydroxy group; a substituted or unsubstituted alkyl group; a substituted or unsubstituted alkoxy group; a substituted or unsubstituted aryl group; or a substituted or unsubstituted heterocyclic group, and D1 and D2 are the same as or different from each other, and are each independently any one selected from the following structures, provided that at least one of D1 and D2 is in the structures, X", X"', and X"" are the same as or different from each other, and are each independently S or Se, Y and Y' are the same as or different from each other, and are each independently CR"', N, SiR"', P, or GeR"', two of G11 to G14 are fluorine, and the others are hydrogen, G15 to G18, G101, and G102 are the same as or different from each other, and are each independently hydrogen; or fluorine, R"' is hydrogen; deuterium; a halogen group; a hydroxy group; a substituted or unsubstituted alkyl group; a substituted or unsubstituted alkoxy group; a substituted or unsubstituted aryl group; or a substituted or unsubstituted heterocyclic group, g is 0 or 1, and when a group is "substituted", it is substituted with one or more substituents selected from the group consisting of deuterium; a halogen group; a nitrile group; a nitro group; an imide group; an amide group; a hydroxy group; an alkyl group; a cycloalkyl group; an alkoxy group; an aryloxy group; an alkylthioxy group; an arylthioxy group; an alkylsulfoxy group; an arylsulfoxy group; an alkenyl group; n aryl group; and a heterocyclic group, or is substituted with a substituent to which two or more substituents are linked among the substituents listed above.