The Dirichlet problem for nonlocal operators with singular kernels: convex and nonconvex domains