
If all of those are "is"'s of identity, both syllogisms are valid.
If, however, B is a predicate, then the second syllogism is invalid.
(The first syllogism, as you have pointed out, is valid--whether B
is a predicate or designates an individual.)